iOS开发之读取info.plist配置信息
直接从info.plist字典里面读取配置信息
简单暴力
[[NSBundle mainBundle].infoDictionary objectForKey:@"对应的key"];
也可
NSString *bundlePath = [[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"];
NSMutableDictionary *infoDict = [NSMutableDictionary dictionaryWithContentsOfFile:bundlePath];
常用系统配置信息的key如下
kCFBundleInfoDictionaryVersionKey ---版本号
kCFBundleIdentifierKey---- 应用bundle ID
kCFBundleVersionKey----应用版本号
kCFBundleNameKey---应用名字