哥们试试谷歌。无论如何,我希望这会减少你的谷歌时间
NSURL *url=[NSURL URLWithString:self.serverURL];
NSMutableURLRequest *requst = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:120];
NSLog(@"request %@ url: %@",requst,self.serviceURL);
//-->data that needs to be posted to the server...
NSString* postDataString = [self preparePostData:dict];
[requst setHTTPMethod:@"POST"];
[requst setHTTPBody:[postDataString dataUsingEncoding:NSUTF8StringEncoding]];
[requst setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[requst setValue:@"application/json" forHTTPHeaderField:@"Accept"];
MyAppDelegate *sharedInstance = (MyAppDelegate *)[[UIApplication sharedApplication] delegate];
[NSURLConnection sendAsynchronousRequest:requst queue:[NSOperationQueue currentQueue] completionHandler:^(NSURLResponse *respone, NSData *data, NSError *error) {
// Code to handle request data
}