iOS版本更新 我们可以在didFinsihLaunchingWithOptions 写处理事件
苹果给我们提供了appStore版本获取接口方法
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://itunes.apple.com/lookup?id=%@",appleID]]];//appleID传入自己app的ID号
[request setHTTPMethod:@"GET"];
NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSDictionary *jsonData = [NSJSONSerialization JSONObjectWithData:returnData options:0 error:nil];in
//可以通过获取到的jsondata 字典数据 获取到App Store版本信息
NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
NSString *currentVersion = [infoDict objectForKey:@"CFBundleVersion"];
double doubleCurrentVersion = [currentVersion doubleValue];
然后通过App Store里的版本号 和本地app的版本号进行对比 如本地版本号低于了App Store的版本号 就提示更新
<span style="font-size: 9pt;">[[UIApplication sharedApplication] openURL:[NSURL URLWithString:trackViewUrl]]; //这里就可以通过传入trackViewUrl <软件在App Store里的地址> 系统就能跳转到更新界面</span>
unchingWithOptions