Re: Style question
Re: Style question
- Subject: Re: Style question
- From: "A.M." <email@hidden>
- Date: Mon, 30 Aug 2010 11:34:06 -0400
On Aug 30, 2010, at 11:29 AM, 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];
>
> ?
According to the Google Objective-C Style Guide, the former is preferable. The rationale for this is pretty solid, too:
http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml?showone=Prefer_To_autorelease_At_Time_of_Creation#Prefer_To_autorelease_At_Time_of_Creation
Cheers,
M_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden