• 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: Joar Wingfors <email@hidden>
  • Date: Mon, 30 Aug 2010 08:37:08 -0700

On 30 aug 2010, at 08.29, Vincent Habchi wrote:

> baz = [[[Foo alloc] init] autorelease];


I think that it's definitively preferable to autorelease on the same line. It keeps all memory management together, and it's much less likely that later rearrangements of the code in question will result in memory leaks.

That said, this is a subjective preference, and there are no official guidelines on the topic. You'll probably find different opinions if you ask around, and you're free to pick any style that you want - as long as you get the memory management right in the end.

j o a r


_______________________________________________

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

  • Follow-Ups:
    • Re: Style question
      • From: "Sean McBride" <email@hidden>
References: 
 >Style question (From: Vincent Habchi <email@hidden>)

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