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 (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