iOS 獲取版本信息之類的問題缭黔,整理一小部分
1:獲取bundle Id信息:[[NSBundle mainBundle]bundleIdentifier];
2: 獲取App顯示名:[[[NSBundle mainBundle]infoDictionary] objectForKey:@"CFBundleDisplayName"];
3:獲取版本號:[[[NSBundle mainBundle]infoDictionary] objectForKey:@"CFBundleVersion"];
[[NSBundle mainBundle]infoDictionary] 獲得的是一個字典蒂破,里邊放著Info.plist文件中的各種信息馏谨,根據(jù)不同的鍵去即可,如:
CFBundleDevelopmentRegion
CFBundleDisplayName
CFBundleExecutable
CFBundleExecutablePath
CFBundleIdentifier
CFBundleInfoDictionaryVersion = "6.0";
CFBundleInfoPlistURL
CFBundleName
CFBundlePackageType
CFBundleShortVersionString
CFBundleSignature
CFBundleSupportedPlatforms