如何从mainBundle NSDictionary中找到我的应用程序的完整版本号?

bod*_*ous 1 ios ios5 xcode4.2

我知道我可以通过mainBundle NSDictionary找到捆绑版本

NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleVersionKey];
Run Code Online (Sandbox Code Playgroud)

这不会给我完整的版本.如何通过CFBundleShortVersionString密钥访问对象?

Poo*_*imi 6

我想你可以这样做:

NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
Run Code Online (Sandbox Code Playgroud)

你不仅限于konstants!