It's easy to set the build and version numbers manually in Xcode, and I learned how to increment them with a macro at build time. But how do I reference their values in code?
NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary]; NSString *appVersion = [infoDict objectForKey:@"CFBundleShortVersionString"]; // example: 1.0.0 NSString *buildNumber = [infoDict objectForKey:@"CFBundleVersion"]; // example: 42
1.4m articles
1.4m replys
5 comments
57.0k users