iOS 版本更新

2018-09-30  本文已影响8人  雪丹妮_66865
  1. 获取本机版本号

NSDictionary *localDic = [[NSBundle mainBundle] infoDictionary];
NSString *localVersions = [localDic objectForKey:@"CFBundleShortVersionString"];

  1. 查看appstore中的软件最新版本

地址:https://itunes.apple.com/lookup?id=软件的apple Id

NSArray *resultArr = responseObject[@"results"];
NSDictionary *resultDic = resultArr.firstObject;
NSString *latestVersion = resultDic[@"version"];

  1. 如果版本不一致,进行更新

if ([latestVersion compare:localVersions options:NSNumericSearch] == NSOrderedDescending) {
[self updateBtnActionwithLatestVersion:latestVersion];
}

上一篇 下一篇

猜你喜欢

热点阅读