title: NSURLConnection sendSynchronousRequest with ARC
body: <p>I am beginning to play around with ARC, and one of the first experiements I was trying was to make an HTTP call to a URL and get back some data. Of course, the HTTP status code is important to me, so that means I went to my "goto" of using <code>sendSynchronousRequest</code> like:</p>
  
  <pre><code>NSError *error = [[NSError alloc] init];
  NSHTTPURLResponse *responseCode = nil;
  
  NSData *oResponseData = [NSURLConnection sendSynchronousRequest:request returningResponse:responseCode error:error];
  </code></pre>
  
  <p>With ARC enabled I get a compiler errors and warnings on that last line.</p>
  
  <p><strong>Errors</strong>:</p>
  
  <blockquote>
    <p>Implicit conversion of an Objective-C pointer to 'NSURLResponse
    *__autoreleasing *' is disallowed with ARC</p>
    
    <p>Implicit conversion of an Objective-C pointer to 'NSError
    *__autoreleasing *' is disallowed with ARC</p>
    
    <p>file://localhost/Users/jason/Projects/test/Data/DataService.m: error:
    Automatic Reference Counting Issue: Implicit conversion of an
    Objective-C pointer to 'NSURLResponse *__autoreleasing *' is
    disallowed with ARC</p>
    
    <p>file://localhost/Users/jason/Projects/test/Data/DataService.m: error:
    Automatic Reference Counting Issue: Implicit conversion of an
    Objective-C pointer to 'NSError *__autoreleasing *' is disallowed with
    ARC</p>
  </blockquote>
  
  <p><strong>Warnings</strong>:</p>
  
  <blockquote>
    <p>Incompatible pointer types sending 'NSHTTPURLResponse *_<em>strong' to
    parameter of type 'NSURLResponse *</em>_autoreleasing *'</p>
    
    <p>Incompatible pointer types sending 'NSError *_<em>strong' to parameter of
    type 'NSError *</em>_autoreleasing *'</p>
  </blockquote>
  
  <p>From what I can tell the reference passing is what is messing this up, but I am unsure what the correct way to resolve this is. Is there a "better" way to accomplish a similar task with ARC?</p>