ios 检查正在使用的应用程序版本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6164370/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 20:08:05  来源:igfitidea点击:

Check what version of the app is being used

objective-ccocoa-touchiosversion-numbering

提问by Marty

Possible Duplicate:
How to display the current project version of my App to the user?

可能的重复:
如何向用户显示我的应用程序的当前项目版本?

Is there a way to check the version number of my app? Is it supplied somewhere once the app is in the App Store?

有没有办法检查我的应用程序的版本号?一旦应用程序在 App Store 中,它是否在某处提供?

回答by Brian Lyttle

I believe this is included in your info.plistfile, and can be retrieved with code like this:

我相信这包含在您的info.plist文件中,可以使用如下代码检索:

[NSString stringWithFormat:@"Version %@",[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]];