• 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 and finalize
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dealloc and finalize


  • Subject: Re: dealloc and finalize
  • From: Nick Zitzmann <email@hidden>
  • Date: Fri, 9 Oct 2009 11:39:11 -0600


On Oct 9, 2009, at 11:31 AM, Gabriel Zachmann wrote:

If my screensaver must be able to run both in the reference-counted and in the garbage collecting environment,
should I then implement both the dealloc and the finalize method?

If you allocated objects in your class that you need to deallocate before going bye-bye, or you registered the class for notifications, then yes, you must implement a -dealloc method unless your code is GC- only. You only need to implement -finalize if you allocated memory outside the garbage collector (for example, using malloc()) and need to free it before the object goes away. Check the documentation for more information.


Nick Zitzmann
<http://www.chronosnet.com/>

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >dealloc and finalize (From: Gabriel Zachmann <email@hidden>)

  • Prev by Date: Re: Hide an Item on Desktop
  • Next by Date: Re: dealloc and finalize
  • Previous by thread: dealloc and finalize
  • Next by thread: Re: dealloc and finalize
  • Index(es):
    • Date
    • Thread