Prefer the first

[[[Foo alloc] init] autorelease];

If there is a @throw between the creation and return, there is a chance (if not 
properly handled) that the autorelease won't be called.

On 30 Aug 2010, at 17:29, Vincent Habchi wrote:

> Hi everybody,
> 
> just an enquiry regarding coding style. What is considered best:
> 
> baz = [[[Foo alloc] init] autorelease];
> …
> return baz;
> 
> or
> 
> baz = [[Foo alloc] init];
> …
> return [baz autorelease];
> 
> ?
> 
> Thanks!
> Vincent_______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/filip%40code2develop.com
> 
> This email sent to fi...@code2develop.com


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to