• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Style question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Style question


  • Subject: Re: Style question
  • From: F van der Meeren <email@hidden>
  • Date: Mon, 30 Aug 2010 17:32:11 +0200

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


_______________________________________________

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

References: 
 >Style question (From: Vincent Habchi <email@hidden>)

  • Prev by Date: Style question
  • Next by Date: Re: Style question
  • Previous by thread: Style question
  • Next by thread: Re: Style question
  • Index(es):
    • Date
    • Thread