title: What are the pros and cons of these different dealloc strategies?
body: <p>I've seen several different approaches to memory management in iOS as regards releasing properties. After some debate with colleagues, the pros and cons have become muddled in my head. </p>
  
  <p>I'm hoping to get a summary of pros and cons that will allow myself and others to easily choose a default approach while still understanding when to make exceptions. Here are the 3 variations I've seen:</p>
  
  <p>Assume <code>@property (nonatomic, retain) MyObject *foo;</code></p>
  
  <pre><code>// Release-only. Seems to be the favored approach in Apple's sample code.
  - (void)dealloc {
      [foo release];
      [super dealloc];
  }
  
  // Property accessor set to nil.
  - (void)dealloc {
      self.foo = nil;
      [super dealloc];
  }
  
  // Release, then nil.
  - (void)dealloc {
      [foo release];
      foo = nil;
      [super dealloc];
  }
  </code></pre>
  
  <p>If you have a different variation to add, comment here and I'll edit the op. </p>