Re: Dealloc method needed?
Re: Dealloc method needed?
- Subject: Re: Dealloc method needed?
- From: Andy Lee <email@hidden>
- Date: Tue, 25 Jun 2002 03:51:48 -0400
At 9:11 AM +0200 6/25/02, Michhle Garoche wrote:
Le mardi 25 juin 2002, ` 08:32 , Nathan Day a icrit :
dealloc is called by the release method when the objects reference
count reaches zero.
Excuse me. My words were not what I meant. I would say should I
implement the release method...?
No. You should *call* -release at appropriate times (generally to
balance calls to -retain), but never override it.
The reverse is true for -dealloc. You should *override* -dealloc if
your object retains other objects, but never call it. As Nathan
pointed out, it will be called implicitly when -release reduces the
retain count to zero.
--Andy
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.