1,版本更新 通過比較構建號/版本號 檢查更新
?
/// ?構建號 50 // NSString * currentVersion = [NSBundle mainBundle].infoDictionary[@"CFBundleVersion"];/// 版本號 2.2.0//CFBundleShortVersionStringNSString * currentVersion = [NSBundle mainBundle].infoDictionary[@"CFBundleShortVersionString"];NSLog(@"receiveData=%@",sender);// sender[@"version"] @"1.1.3"if ( [sender[@"version"] compare:currentVersion options:NSNumericSearch] == NSOrderedDescending) {UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"提示" message:@"有新版本更新,是否前往AppStore下載" delegate:self cancelButtonTitle:@"不去" otherButtonTitles:@"立即前往", nil];alert.tag = 1000;/// 上線前打開 [alert show];}
?
/*線上 compare 本地if ( [@"1.2.0" compare:@"1.1" options:NSNumericSearch] == NSOrderedDescending) {NSLog(@"1.2>1.1.1");}*/
?