• 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: newbie question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newbie question


  • Subject: Re: newbie question
  • From: "Alan Smith" <email@hidden>
  • Date: Fri, 10 Nov 2006 11:37:40 -0500

Hi Maximilian,

One thing I didn't realize for quite some time when I was first
learning how to use the Cocoa frameworks is that all methods that have
the plus before them, should, return an autoreleased instance.
Autoreleased objects are not something you should use a lot of because
they don't get released until your program quits, or sooner if you're
controlling the pool and specifically release it.

I prefer: NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
           // Lots of code
           [dict release];

Over: NSMutableDictionary *dict = [NSMutableDictionary dictionary];

Keeping your memory clean makes your program faster and look better.

Peace, Alan


-- // Quotes from yours truly ------------------------- "You don't forget, you just don't remember." "Maturity resides in the mind." "Silence is the Universe's greatest gift." "When the World realizes that religion really is unimportant, then it shall evolve." _______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: newbie question
      • From: Bill Bumgarner <email@hidden>
References: 
 >newbie question (From: maximilian marcoll <email@hidden>)

  • Prev by Date: [Moderator] List guidelines and related resources (updated)
  • Next by Date: Re: newbie question
  • Previous by thread: Re: newbie question
  • Next by thread: Re: newbie question
  • Index(es):
    • Date
    • Thread