On 1/7/09 2:25 PM, Ron Lue-Sang said:

>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.

Ronzilla,

Thanks for your reply.

So if in my implementation of bind:toObject:withKeyPath:options: I add
myself as an observer, when is the correct time to remove myself as an
observer?

This example:
<http://developer.apple.com/samplecode/BindingsJoystick/listing4.html>

a) overrides unbind: and calls removeObserver there.  Is that correct?

b) calls unbind: from dealloc.  Is that correct?

c) in GC, assuming a client does not unbind: manually, when is the right
time to stop the observations started in bind:?

Cheers,

--
____________________________________________________________
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/archive%40mail-archive.com

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

Reply via email to