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---应用名字

转载于:https://www.cnblogs.com/hecanlin/p/11046927.html

猜你喜欢

转载自blog.csdn.net/weixin_33704591/article/details/93697475