Re: Still learning about NSAutoReleasePool
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