title: How to get server response data in NSURLSession without completion block
body: <p>I am using <code>NSURLSession</code> for background image uploading. And according to uploaded image my server gives me response and I do change in my app accordingly. But I can't get my server response when my app uploading image in background because there is no completion block.</p>
  
  <p>Is there way to get response without using completion block in <code>NSURLUploadTask</code>?</p>
  
  <p>Here is my code :</p>
  
  <pre><code> self.uploadTask = [self.session uploadTaskWithRequest:request fromData:body completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
              NSString *returnString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
              NSLog(@"returnString : %@",returnString);
              NSLog(@"error : %@",error);
          }];
   [self.uploadTask resume];
  </code></pre>
  
  <p>But i got this error..</p>
  
  <blockquote>
    <p>Terminating app due to uncaught exception 'NSGenericException', reason: 'Completion handler blocks are not supported in background sessions. Use a delegate instead.'</p>
  </blockquote>
  
  <p>But if I can't use completion handler than how should I get the server response. It says use delegate but I can't find any delegate method which can gives me server response.</p>