我想记录应用版本号,以便用户发送反馈时能够在电子邮件中看到该版本号。
我该如何获取这个版本号呢?
我该如何获取这个版本号呢?
NSDictionary* infoDict = [[NSBundle mainBundle] infoDictionary];
NSString* versionNum = [infoDict objectForKey:@"CFBundleVersion"];
NSString *appName = [infoDict objectForKey:@"CFBundleDisplayName"];
NSString *text = [NSString stringWithFormat:@"%@ %@",appName,versionNum];
您可以使用此代码同时发送应用程序名称和版本号。
[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]]