如何从xcode获取自己的应用程序版本? [英] How to get your own app version from xcode?

查看:96
本文介绍了如何从xcode获取自己的应用程序版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道在将其放入xCode的摘要标签中后,是否有办法在代码中获取自己的应用版本。一种方法似乎是搜索 Info.plist 获取 CFBundleVersion 键,但还有其他更方便,更方便办法?

I wonder if there is a way to get your own app version in code after you put it in the "Summary" tab in xCode. One way seems to be to search Info.plist for CFBundleVersion key, but is there any other, easier, more convenient way?

推荐答案

您可以在主包中找到它。我认为它类似于:

You can find it in the main bundle. I think it's something like:

[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];

这篇关于如何从xcode获取自己的应用程序版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆