• 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: retain, copy, release, autorelease...leak
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: retain, copy, release, autorelease...leak


  • Subject: Re: retain, copy, release, autorelease...leak
  • From: Robert Lee Dotson <email@hidden>
  • Date: Thu, 28 Jun 2001 17:03:37 -0400

Natch. I meant, you never need to call release on objects that have been autoreleased. Only on the objects where you've specifically called retain. I can think of few reasons to call retain, since objects stick around when passed as return values or added to collection classes.

On Thursday, June 28, 2001, at 04:52 PM, Finlay Dobbie wrote:


On Thursday, June 28, 2001, at 09:32 pm, email@hidden wrote:

You do not need to retain or release objects created with class methods (arrayWithCapacity: is a class method for NS*Array), only those created with [[... alloc] init*:] methods.

Uhm, this is incorrect. You need to retain them if you want them to stick around, and then release them when you want them to go away if they have been retained.

-- Finlay


-- Robert Lee Dotson

"Let us never negotiate out of fear but never let us fear to negotiate." --John F. Kennedy


  • Prev by Date: Re: retain, copy, release, autorelease...leak
  • Next by Date: Re: NSTextView unselects on tab clicks...
  • Previous by thread: Re: retain, copy, release, autorelease...leak
  • Next by thread: NSStringAdditions drawAtPoint
  • Index(es):
    • Date
    • Thread