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

发布时间:2020-09-14 11:42:59 作者:Hi_Aaron
来源:脚本之家 阅读:178

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

看代码的时候看到一句,用于获取.plist文件的版本号

labelVersion.text = [NSString stringWithFormat:@"v%@", [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey]]; 

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

比较感兴趣的是后面的参数 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 开发的文章本站还有很多,大家可以参考,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

推荐阅读:
  1. iOS上架该怎么做?
  2. 详解iOS Project和Targets配置

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

ios app 版本号

上一篇:怎么用css做form表单的方法

下一篇:怎么使用HTML5+CSS3来创建淡入效果的提示框

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》