On Jan 7, 2009, at 1:55 PM, Sean McBride wrote:

Hi all,

Is it safe to call unbind: in finalize?  Is unbind: thread-safe?

Traditionally, Apple has recommended calling unbind: in a view's dealloc
method.  With GC one might be tempted to call it in finalize, but 1)
finalize is discouraged in general 2) finalize implementations must be
thread safe. The docs make no guarantee about unbind:'s thread safety.

You don't need to call unbind: from finalize.

If you're an observer of some other object, and you haven't removed yourself as an observer by the time you're in finalize… well, try to clean up any observing by the time you hit finalize.

When do AppKit views call unbind:?

Most views, currently, don't call unbind: on themselves at all.


(I know this has been discussed before, by me no less, and I am familiar
with mmalc's recommendations on his bindings page.)

Thanks,

--
____________________________________________________________
Sean McBride, B. Eng                 s...@rogue-research.com
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

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/luesang%40apple.com

This email sent to lues...@apple.com


--------------------------
RONZILLA



_______________________________________________

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