NSDictionary *infoDic = [[NSBundle mainBundle] infoDictionary];
NSString *currentVersion = [NSString stringWithFormat:@"当前软件版本为:%@",infoDic[@"CFBundleShortVersionString"]];
UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"软件版本" message:currentVersion delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil,nil];
[alertView show];
本文介绍了一种在iOS应用中获取当前应用版本号的方法。通过使用NSBundle提供的接口,可以轻松地从应用程序的信息属性列表中读取版本信息,并通过UIAlertView显示给用户。
1万+

被折叠的 条评论
为什么被折叠?



