• 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: Dealloc method needed?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Dealloc method needed?
      • From: email@hidden
References: 
 >Re: Dealloc method needed? (From: Michèle Garoche <email@hidden>)

  • Prev by Date: Re: NSString drawAt: ...
  • Next by Date: Where can I find a list with ALL available attributes which can be used with (NSString's) drawInRect: withAttributes
  • Previous by thread: Re: Dealloc method needed?
  • Next by thread: Re: Dealloc method needed?
  • Index(es):
    • Date
    • Thread