直接上代码:
//获取系统info.plist文件中的键值对 NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary]; //获取软件的版本号 NSString *version = [infoDict objectForKey:@"CFBundleVersion"]; NSLog(@"版本号是=%@",version); //打印系统plist中所有的键值对 for (id key in infoDict) { NSLog(@"key:%@,value:%@",key,[infoDict objectForKey:key]); }
输入日志如下: