标签:new ring show delegate 版本 最新版 standard ios string
//检查版本更新 -(void)checkVersionUpdate{ //检查更新 NSString *stringVer = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey]; [[NetWorkRequest shareRequest]updateNewVersionWithversioncode:stringVer serverSuccessFn:^(id response) { if ([[response objectForKey:@"qzupdate"] intValue] == 1 && [[response objectForKey:@"updateurl"] length] > 0) { DebugLog(@"需要强制更新"); NSString *mes = [NSString stringWithFormat:@"发现最新版本%@,需更新后才能继续使用\n更新内容:%@",[response objectForKey:@"versioncode"],[response objectForKey:@"descr"]]; UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:mes delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil]; alertView.tag = 1001; [alertView show]; }else if ([[response objectForKey:@"isupdate"] intValue] == 1 && [[response objectForKey:@"updateurl"] length] > 0) { NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; NSString *version = [userDefaults objectForKey:@"Version_To_Update"];//待更新的版本 version_to_update = [response objectForKey:@"versioncode"]; if ([stringVer floatValue] < [version floatValue] && [version_to_update floatValue] <= [version floatValue]) { //当前待更新版本已点击取消并在本地保存的待更新版本,不弹出提示框 }else { //弹出提示框进行更新 NSString *mes = [NSString stringWithFormat:@"发现最新版本%@,是否更新?\n更新内容:%@",[response objectForKey:@"versioncode"],[response objectForKey:@"descr"]]; UIAlertView *alertTi = [[UIAlertView alloc] initWithTitle:@"提示" message:mes delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; alertTi.tag = 1002; [alertTi show]; } }else{ //DebugLog(@"不需要更新"); } } serverFailureFn:^(NSError *error, id response) { }]; }
标签:new ring show delegate 版本 最新版 standard ios string
原文地址:https://www.cnblogs.com/ios-wmm/p/10216070.html