Skip to content

Instantly share code, notes, and snippets.

@danmartyn
Created July 29, 2013 04:15
Show Gist options
  • Save danmartyn/6102115 to your computer and use it in GitHub Desktop.
Save danmartyn/6102115 to your computer and use it in GitHub Desktop.
Returns the app name, version and build number
- (NSString *)appNameAndVersionNumberDisplayString {
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
NSString *appDisplayName = [infoDictionary objectForKey:@"CFBundleDisplayName"];
NSString *majorVersion = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
NSString *minorVersion = [infoDictionary objectForKey:@"CFBundleVersion"];
return [NSString stringWithFormat:@"%@, Version %@ (%@)",
appDisplayName, majorVersion, minorVersion];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment