首页 > 代码库 > iOS Appstore 版本更新

iOS Appstore 版本更新

1,版本更新 通过比较构建号/版本号 检查更新

 

///  构建号 50
//    NSString * currentVersion = [NSBundle mainBundle].infoDictionary[@"CFBundleVersion"];
    /// 版本号 2.2.0
    //CFBundleShortVersionString
    NSString * currentVersion = [NSBundle mainBundle].infoDictionary[@"CFBundleShortVersionString"];
   
    NSLog(@"receiveData=http://www.mamicode.com/%@",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];
    }

 

iOS Appstore 版本更新