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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to