title: Returning a pointer to memory allocated within a function
body: <p>In C, something like the following would be a disaster (ie, a memory leak) because you're returning a pointer to memory that you will never be able to free:</p>
  
  <pre><code>NSString* foo()
  {
    return [NSString stringWithFormat:@"%i+%i=%i", 2, 2, 2+2];
  }
  </code></pre>
  
  <p>Is that in fact totally fine in Objective-C since the memory that the returned pointer points to will be autoreleased?  Even if it is OK, is it frowned upon for any reason?  Any reason to prefer the C style, as below?</p>
  
  <pre><code>void foo(NSString ** modifyMe)
  {
    *modifyMe = [NSString stringWithFormat:@"%i+%i=%i", 2, 2, 2+2];
  }
  </code></pre>