首页 > 移动平台 > 详细

ios获取app版本号

时间:2014-02-25 12:26:25      阅读:388      评论:0      收藏:0      [点我收藏+]

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

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

bubuko.com,布布扣


比较感兴趣的是后面的参数 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版本号

原文:http://blog.csdn.net/chaoyuan899/article/details/19812823

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!