不建议使用,使用应用版本更新功能提交App Store会被拒!
一.在#import "AppDelegate.h" 文件中的application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 方法中调用检测结果
![](https://img.haomeiwen.com/i3018930/be0d113ce8ece94c.png)
二. 获得发布版本的Version
![](https://img.haomeiwen.com/i3018930/5a32cede2534dc98.png)
三.比较当前版本与新上线版本做比较
![](https://img.haomeiwen.com/i3018930/85f1a8c3ad549dfe.png)
四.UIAlertView代理方法
![](https://img.haomeiwen.com/i3018930/2ffd5cbc000b5acb.png)
获取设备或APP信息
//返回应用程序名称
+(NSString *) getAppName{
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
return [infoDictionary objectForKey:@"CFBundleDisplayName"];
}
//返回应用版本号
+(NSString *) getAppVersion{
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
return [infoDictionary objectForKey:@"CFBundleShortVersionString"];
}
+(NSString *) getAppBundleVersion{
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
return [infoDictionary objectForKey:@"CFBundleVersion"];
}
//设备型号
+(NSString *) getSystemName{
return [[UIDevice currentDevice] systemName];
}
//设备版本号
+(NSString *) getSystemVersion{
return [[UIDevice currentDevice] systemVersion];
}
网友评论