title: NSURLSession with NSBlockOperation and queues
body: <p>I have an app that currently uses <code>NSURLConnection</code> for the vast majority of its networking. I would like to move to <code>NSURLSession</code> because Apple tells me that is the way to go.</p>
  
  <p>My app just uses the synchronous version of <code>NSURLConnection</code> by way of the <code>+ (NSData *)sendSynchronousRequest:(NSURLRequest *)request returningResponse:(NSURLResponse **)response error:(NSError **)error</code> class method. I do this within a <code>NSBlockOperation</code> running on an <code>NSOperationQueue</code> so I am not needlessly blocking the main queue. The big advantage to doing things this way is that I can make the operations dependent on one another. For example, I can have the task that is requesting data be dependent on the login task finishing.</p>
  
  <p>I have not seen any support for synchronous operations within <code>NSURLSession</code>. All I can find are articles deriding me for even thinking of using it synchronously and that I am a horrible person for blocking the threads. Fine. But I see no way to make <code>NSURLSessionTask</code>s dependent on each other. Is there a way to do that?</p>
  
  <p>Or is there a description of how I would do such a thing in a different way?</p>