NSURLSession delegate vs. completionHandler
问题 I've always used completion handlers. With NSURLConnection and now with NSURLSession . It's led to my code being really untidy, especially I have request within request within request. I wanted to try using delegates in NSURLSession to implement something I've done untidily with NSURLConnection . So I created a NSURLSession , and created a dataTask : NSURLSessionDataTask *dataTask = [overallSession dataTaskWithURL:url completionHandler:^(NSData *data, NSURLResponse *response, NSError *error)