title: In Objective-C why should I check if self = [super init] is not nil?
body: <p>I have a general question about writing init methods in Objective-C.</p>
  
  <p>I see it everywhere (Apple's code, books, open source code, etc.) that an init method should check if self = [super init] is not nil before continuing with initialisation.</p>
  
  <p>The default Apple template for an init method is:</p>
  
  <pre><code>- (id) init
  {
      self = [super init];
  
      if (self != nil)
      {
          // your code here
      }
  
      return self;
  }
  </code></pre>
  
  <p>Why?</p>
  
  <p>I mean when is init ever going to return nil? If I called init on NSObject and got nil back, then something must be really screwed, right? And in that case, you might as well not even write a program...</p>
  
  <p>Is it really that common that a class' init method may return nil? If so, in what case, and why?</p>