#pragma mark -- 获取appstore版本号-(void)Postpath:(NSString *)path{NSString *url = [[NSString alloc] initWithFormat:@"http://itunes.apple.com/lookup?id=%@",@"414478124"];NSURL *url = [NSURL URLWithString:path];NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:10];[request setHTTPMethod:@"POST"];NSOperationQueue *queue = [NSOperationQueue new];[NSURLConnection sendAsynchronousRequest:request queue:queue completionHandler:^(NSURLResponse *response,NSData *data,NSError *error){ NSMutableDictionary *receiveStatusDic=[[NSMutableDictionary alloc]init]; if (data) { NSDictionary *receiveDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil]; if ([[receiveDic valueForKey:@"resultCount"] intValue]>0) { [receiveStatusDic setValue:@"1" forKey:@"status"]; [receiveStatusDic setValue:[[[receiveDic valueForKey:@"results"] objectAtIndex:0] valueForKey:@"version"] forKey:@"version"]; }else{ [receiveStatusDic setValue:@"-1" forKey:@"status"]; } }else{ [receiveStatusDic setValue:@"-1" forKey:@"status"]; } [self performSelectorOnMainThread:@selector(receiveData:) withObject:receiveStatusDic waitUntilDone:NO];}]; } -(void)receiveData:(id)sender { NSLog(@"receiveData=%@",sender); //打印获取到的版本号} #pragma mark -- //获取本地版本号 //获取本地版本号 NSString* thisVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; 3.跳转到AppStore下载//APPid需要填写自己app的idNSString *urlStr = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%@",APPID];NSURL *url = [NSURLURLWithString:urlStr];[[UIApplication sharedApplication]openURL:url];