title: When is NS_RETURNS_RETAINED needed?
body: <p>Take the below example:</p>
  
  <pre><code>- (NSString *)pcen NS_RETURNS_RETAINED {
      return (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(NULL, (__bridge CFStringRef) self, NULL, (CFStringRef) @"!*'();:@&amp;=+$,/?%#[]", kCFStringEncodingUTF8);
  }
  </code></pre>
  
  <p>Is it correct to put the <code>NS_RETURNS_RETAINED</code> there?
  <br/><br/><br/>
  Another example:</p>
  
  <pre><code>+ (UIImage *)resizeImage:(UIImage *)img toSize:(CGSize)size NS_RETURNS_RETAINED {
      UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
      [img drawInRect:...];
      UIImage *resizedImage = UIGraphicsGetImageFromCurrentImageContext();
      UIGraphicsEndImageContext();
      return resizedImage;
  }
  </code></pre>
  
  <p>That seems more complicated, as the returned UIImage is the result of a 'Get' method. However, the graphics context it's getting it from was created within the scope of the method, so is it correct to also have <code>NS_RETURNS_RETAINED</code> here?
  <br/><br/><br/>
  And a third example:</p>
  
  <pre><code>@property (readonly) NSArray *places;
  ---
  @synthesize places=_places;
  ---
  - (NSArray *)places {
      if (_places)
          return _places;
      return [[NSArray alloc] initWithObjects:@"Unknown", nil];
  }
  </code></pre>
  
  <p>No idea what to do here, as the returned object could be newly created or not.
  <br/><br/><br/>
  And one last question; presumably <code>NS_RETURNS_RETAINED</code> isn't required if the object returned is the result of an autorelease'ed method. So say the return in the last example was amended to</p>
  
  <p><code>return [NSArray arrayWithObject:@"Unknown"];</code></p>
  
  <p>what would be best practise then?</p>