美文网首页
iOS开发获取版本号

iOS开发获取版本号

作者: Stephen_Huang | 来源:发表于2019-09-27 14:35 被阅读0次
//此获取的版本号对应bundle,打印出来对应为12345这样的数字
NSNumber *number = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleVersionKey];

//此获取的版本号对应version,打印出来对应为1.2.3.4.5这样的字符串
NSString *string = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];

相关文章

网友评论

      本文标题:iOS开发获取版本号

      本文链接:https://www.haomeiwen.com/subject/ielnectx.html