title: Correct approach for checking memory allocations in Objective C
body: <p>I'm wondering what would be the correct approach after executing a command that allocates memory in Objective C (I'm mainly referring to iOS apps).
  My dilemma comes from the fact that checking for the success of failure of a memory allocation operation adds lots of lines of code, while wondering whether this is at all useful.
  Moreover, sometimes memory allocations are obvious, such as using 'alloc', but sometimes they are taking place behind the scenes. And even if we check each and every allocation - when we find it failed - there isn't much we could actually do. So maybe the correct approach is to just let it fail and have the app crash?
  Take a look at this code:</p>
  
  <pre><code>// Explicit memory allocation
  NSArray a1 = [[NSArray alloc] initWithObjects:someObj, nil];
  if (!a1) {
    // Should we make this check at all? Is there really what to do?
  }
  
  // Implicit memory allocation
  NSArray a2 = [NSArray arrayWithObjects:someObj, nil];
  if (!a2) {
    // should we make this check at all? Is there really what to do?
  }
  </code></pre>
  
  <p>What in your opinion would be the correct approach? Check or not check for allocation failures? iOS developers out there - how have you handled it in your apps?</p>