iOS获取应用程序信息
有时候需要获得程序的一些信息,比如需要用到程序的版本号的地方,我们就可以直接获得程序的版本号,然后在代码中使用,这样在修改程序的版本号的时候只需要修改一个地方就OK了。
为了方便使用,列出了一部分的信息 ~~~~~~
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
[infoDictionary objectForKey:@"CFBundleVersion"];
//应用程序名:
[infoDictionary objectForKey:@"CFBundleDisplayName"];
//其他的一些信息
{
CFBundleDevelopmentRegion = en;
CFBundleDisplayName = "";
CFBundleExecutable = "";
CFBundleExecutablePath = "";
CFBundleIdentifier = "";
CFBundleInfoDictionaryVersion = "6.0";
CFBundleInfoPlistURL = "";
CFBundleName = "";
CFBundlePackageType = APPL;
CFBundleShortVersionString = "1.0";
CFBundleSignature = "????";
CFBundleSupportedPlatforms = (
iPhoneSimulator
);
CFBundleVersion = "1.0";
DTPlatformName = iphonesimulator;
DTSDKName = "iphonesimulator6.1";
LSRequiresIPhoneOS = 1;
NSBundleInitialPath = "";
NSBundleResolvedPath = "";
UIDeviceFamily = (
1,
2
);
UIRequiredDeviceCapabilities = (
armv7
);
UISupportedInterfaceOrientations = (
UIInterfaceOrientationPortrait,
UIInterfaceOrientationLandscapeLeft,
UIInterfaceOrientationLandscapeRight
);
}