title: autorelease vs. release in dealloc
body: <p>I know memory management in iOS is tricky subject to newbies like me, but I was hoping for a clear explanation here on stackoverflow which I could not find anywhere else. </p>
  
  <p>So, pretend I have a property / ivar</p>
  
  <pre class="lang-objc prettyprint-override"><code>@property(nonatomic, retain) UIPopoverController *popOver;
  </code></pre>
  
  <p>which I'm allocating like this:</p>
  
  <pre><code>self.popOver = [[[UIPopoverController alloc] initWithContentViewController:popOverContent] autorelease];    
  </code></pre>
  
  <p>Now, in my dealloc and viewDidUnload methods, I do both</p>
  
  <pre><code>// in viewDidUnload:
  self.popOver = nil;
  // in dealloc:
  [popOver release];
  </code></pre>
  
  <p>Question:</p>
  
  <ol>
  <li>If I do nil / release in viewDidUnload / dealloc, do I really need to autorelease at allocation?</li>
  <li>Vice versa, if I do autorelease at allocation, do I need to nil / release later?</li>
  <li>What's the difference, if any?</li>
  </ol>
  
  <p>Thanks in advance for your time - I'll continue reading, seriously memory management can't be that hard to wrap your head around...</p>