How to return NSData from NSURLSessionDataTask completion handler
问题 I am trying to make a simple class that I can use to call a post web service. Everything is working perfectly except that I am not able to return the NSData . This is my code: + (NSData *)postCall:(NSDictionary *)parameters fromURL:(NSString *)url{ NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration]; NSMutableArray *pairs = [[NSMutableArray alloc]init]; for(NSString