• 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: Still learning about NSAutoReleasePool
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Still learning about NSAutoReleasePool


  • Subject: Re: Still learning about NSAutoReleasePool
  • From: Eric Brunstad <email@hidden>
  • Date: Sat, 11 Jun 2005 13:24:02 -0400


On Jun 11, 2005, at 12:47 PM, Prachi Gauriar wrote:

None of this stuff is a big problem if you just learn the relatively simple rules of reference counting in Cocoa:

Method         Effect on reference count
-alloc*             refCount = 1
-copy*              refCount = 1
+new*               refCount = 1

-retain             refCount += 1
-release            refCount -= 1
-autorelease        refCount -= 1 "later"

-Prachi

I agree with Prachi; stop worrying about the specifics of autorelease pools and such. Instead, look through your code and make notes of the reference counts of objects at a particular time.


This really shouldn't be so complicated.

BTW: I was wrong about NSAutoreleasePool before. As Correia said, sending more than one -autorelease message to an object should result in the reference count being decremented that many times later.

-Eric
_______________________________________________
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


References: 
 >Still learning about NSAutoReleasePool (From: "Theodore H. Smith" <email@hidden>)
 >Re: Still learning about NSAutoReleasePool (From: Prachi Gauriar <email@hidden>)

  • Prev by Date: Re: Cocoa menus in Carbon App
  • Next by Date: Re: Cocoa menus in Carbon App
  • Previous by thread: Re: Still learning about NSAutoReleasePool
  • Next by thread: Passing more than 1 variable to a method/function
  • Index(es):
    • Date
    • Thread