[[NSBundle mainBundle] infoDictionary]
NSBundle* mainBundle = [NSBundle mainBundle];
NSDictionary* infoDictionary = [mainBundle infoDictionary];
NSLog(@"infoDictionary:%@ ", infoDictionary );// infoDictionary 包含了项目中几乎所有的基本信息,SDK版本,项目名称等。
打印结果如下:
infoDictionary:{
CFBundleDevelopmentRegion = en;
CFBundleExecutable = goShopping;
CFBundleIcons = {
CFBundlePrimaryIcon = {
CFBundleIconFiles = (
AppIcon40x40,
AppIcon60x60
);
};
};
CFBundleIdentifier = “lz.goShopping”;
CFBundleInfoDictionaryVersion = “6.0”;
CFBundleInfoPlistURL = “Info.plist – file:///Users/a2014-215/Library/Developer/CoreSimulator/Devices/A06D99D0-EFE1-4442-B49C-CDC272E0A12D/data/Containers/Bundle/Application/D57318FB-4930-4DD0-B53B-05FE1F837B9B/goShopping.app/”;
CFBundleName = goShopping;
CFBundleNumericVersion = 16809984;
CFBundlePackageType = APPL;
CFBundleShortVersionString = “1.0”;
CFBundleSignature = “????”;
CFBundleSupportedPlatforms = (
iPhoneSimulator
);
CFBundleVersion = 1;
DTPlatformName = iphonesimulator;
DTSDKName = “iphonesimulator8.3”;
LSRequiresIPhoneOS = 1;
MinimumOSVersion = “8.0”;
UIDeviceFamily = (
1
);
UILaunchStoryboardName = LaunchScreen;
UIRequiredDeviceCapabilities = (
armv7
);
UISupportedInterfaceOrientations = (
UIInterfaceOrientationPortrait,
UIInterfaceOrientationLandscapeLeft,
UIInterfaceOrientationLandscapeRight
);
}
2.