获取appstore应用版本号
WS(ws);
ddownStr = @"http://itunes.apple.com/lookup?id=********";
[self defaultRequestwithURL:ddownStr withParameters:nil withMethod:kPOST withBlock:^(NSDictionary *dict, NSError *error) {
NSDictionary *infoDic = [[NSBundle mainBundle] infoDictionary];
NSString *currentVersion = infoDic[@"CFBundleShortVersionString"];
if ([dict objectForKey:@"results"]) {
NSArray *tempArr = [dict objectForKey:@"results"];
if (tempArr.count > 0) {
NSDictionary *tempDic = [tempArr objectAtIndex:0];
if ([tempDic objectForKey:@"version"]) {
NSString *verstring = [NSString stringWithFormat:@"%@",[tempDic objectForKey:@"version"]];
//获取当前版本号
NSInteger currentVerRR =
[[(NSMutableString *)currentVersion stringByReplacingOccurrencesOfString:@"." withString:@""] intValue];
//获取最新VV
NSInteger cNewVerRR =
[[(NSMutableString *)verstring stringByReplacingOccurrencesOfString:@"." withString:@""] intValue];
if (cNewVerRR > currentVerRR) {
//逻辑判断
}
}
}
}
}];