标签:with ble fragment array log sea url blog 查看
//请求苹果商店,查看商店在线版本的版本号 [[[NSURLSession sharedSession] dataTaskWithURL:[NSURL URLWithString:@"http://itunes.apple.com/lookup?id=328266349"] completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { if (!error) { NSDictionary *responseObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil]; if (responseObject.count > 0) { NSArray *array = responseObject[@"results"]; NSDictionary *dict = [array lastObject]; NSString *VersionString = [dict objectForKey:@"version"]; // NSString* version =[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]; // NSComparisonResult result = [version compare:VersionString options:NSNumericSearch]; if (result == NSOrderedAscending || result == NSOrderedSame) { // } } } }]resume];
标签:with ble fragment array log sea url blog 查看
原文地址:http://www.cnblogs.com/iOSDeng/p/6244016.html