源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

IOS 获取APP 版本号的实例详解

  • 时间:2022-01-09 22:32 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:IOS 获取APP 版本号的实例详解
[b]IOS 获取APP 版本号的实例详解[/b] 看代码的时候看到一句,用于获取.plist文件的版本号
labelVersion.text = [NSString stringWithFormat:@"v%@", [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey]]; 

[img]http://files.jb51.net/file_images/article/201707/201771595935234.jpg?20176151002[/img] 比较感兴趣的是后面的参数 kcFBundleVersionKey ,竟然是CFBundle.h已经定于好的属性,下面有这个属性的注释
const CFStringRef kCFBundleVersionKey;
  /* The version number of the bundle. For Mac OS 9 style version numbers (for example "2.5.3d5"), */
  /* clients can use CFBundleGetVersionNumber() instead of accessing this key directly since that */
  /* function will properly convert the version string into its compact integer representation. */
还有好多是kcFXXX开头的Standard Info.plist keys 属性,有兴趣可以自己看一下CFBundle.h,研究一下它们的用法, 以上就是IOS 获取APP 版本号的简单实例,关于IOS 开发的文章本站还有很多,大家可以参考,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部