On Mon, Apr 5, 2010 at 3:08 AM, Jerry Krinock <je...@ieee.org> wrote:
> I already use MAKVONotificationCenter in this project, but I don't see the 
> need for it here.  In the array controller's -dealloc,
>
>    [self removeObserver:self
>              forKeyPath:@"selectedObjects"] ;
>
> Why is that perilous?  (It seems to work.)

Because if NSArrayController also self-observes on @"selectedObjects",
you've removed that observation from under its feet.

MAKVONotificationCenter and OFBinding solve this problem by creating
separate objects, so they'll only ever register for a keypath once.

--Kyle Sluder
_______________________________________________

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