title: iOS __autoreleasing const error
body: <p>So I'm doing the usual where I'm passing a pointer to an NSError object to a method.  It used to be a simple: </p>
  
  <pre><code>-(BOOL)foo:(NSString *)string error:(NSError **)error
  </code></pre>
  
  <p>but with ARC it is now:</p>
  
  <pre><code>-(BOOL)foo:(NSString *)string error:(NSError *__autoreleasing *)error
  </code></pre>
  
  <p>So if I have a variable:</p>
  
  <pre><code>NSError *error = nil;
  </code></pre>
  
  <p>and attempt:</p>
  
  <pre><code>[foo:@"a string" error:&amp;error];
  </code></pre>
  
  <p>I'm getting the error:</p>
  
  <pre><code>Sending 'NSError const __strong*' to parameter of type 'NSError *__autoreleasing*' changes retain/release properties of pointer.
  </code></pre>
  
  <p>That's fine, even though I was under the impression that the compiler would handle this for you.  So I make error:</p>
  
  <pre><code>__autoreleasing NSError *error = nil;
  </code></pre>
  
  <p>and I get the warning:</p>
  
  <pre><code>Sending 'NSError *__autoreleasing const *' to parameter of type 'NSError *__autoreleasing*' discards qualifier
  </code></pre>
  
  <p>So my real question is why is my NSError a const?  And my next question is how do I fix this?  This is a very basic situation here, and with now with ARC I'm just not sure how to take care of this.</p>