Reputation: 4732
I want to log the app version number so when user sends feedback, it will be in the email.
How can I get the number?
Upvotes: 11
Views: 1284
Reputation: 1
[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]]
Upvotes: 0
Reputation: 10393
NSDictionary* infoDict = [[NSBundle mainBundle] infoDictionary];
NSString* versionNum = [infoDict objectForKey:@"CFBundleVersion"];
NSString *appName = [infoDict objectForKey:@"CFBundleDisplayName"];
NSString *text = [NSString stringWithFormat:@"%@ %@",appName,versionNum];
You can send both the appname and version number using this code.
Upvotes: 20