1、读取Info.plist(注意I是大写,并且这里大小写敏感,坑)
NSString * infoplistPath = [[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"];
NSMutableDictionary * infoDict = [[NSMutableDictionary alloc] initWithContentsOfFile:infoplistPath];
NSLog(@"%@", infoDict);
读取信息:
2015-11-11 15:01:05.918 01-plist[2745:140559] {
BuildMachineOSBuild = 14F1021;
CFBundleDevelopmentRegion = en;
CFBundleExecutable = "01-plist";
CFBundleIdentifier = "dzl.-1-plist";
CFBundleInfoDictionaryVersion = "6.0";
CFBundleName = "01-plist";
CFBundlePackageType = APPL;
CFBundleShortVersionString = "1.0";
CFBundleSignature = "????";
CFBundleSupportedPlatforms = (
iPhoneSimulator
);
CFBundleVersion = 1;
DTCompiler = "com.apple.compilers.llvm.clang.1_0";
DTPlatformBuild = "";
DTPlatformName = iphonesimulator;
DTPlatformVersion = "9.1";
DTSDKBuild = 13B5110e;
DTSDKName = "iphonesimulator9.1";
DTXcode = 0710;
DTXcodeBuild = 7B60;
LSRequiresIPhoneOS = 1;
MinimumOSVersion = "9.1";
UIDeviceFamily = (
1,
2
);
UILaunchStoryboardName = LaunchScreen;
UIMainStoryboardFile = Main;