title: Is this an objective-c memory leak?
body: <p>I know that if you do the following you most certainly have a memory leak:</p>
  
  <pre><code>id foo = [[NSObject alloc] init];
  foo = nil;
  </code></pre>
  
  <p>But, what if you're using self.foo, a property with retain? And your code instead looks like the following:</p>
  
  <pre><code>foo = [[NSObject alloc] init];
  self.foo = nil;
  </code></pre>
  
  <p>Is that still a memory leak since the accessor releases the memory first before setting it to nil?</p>