Unregistering KVO observers
Unregistering KVO observers
- Subject: Unregistering KVO observers
- From: Steve Nicholson <email@hidden>
- Date: Thu, 17 Apr 2008 12:59:46 -0700
I'm using NSDocument/NSWindowController with bindings in the
NSWindowController subclass set up in Interface Builder. When I close
the window, I get the message "An instance 0x306860 of class Problem
is being deallocated while key value observers are still registered
with it." I'd like to unregister the window with all of its key value
observers, but I can't figure out how.
Does the window have access to a list of all its observers that I can
use for unregistering? I thought the observationInfo method looked
promising, but it returns a pointer to an opaque structure. I can see
the contents of the structure in gdb, but I can't get at them in code.
Or do I have to make every observer an IBObject and call
removeObserver:forKeyPath: for each one? If I do it that way, how do
I know what to use for keyPath?
I'm sorry if I'm missing something obvious. I've done my best to find
an answer with Google, but no luck.
-Steve
_______________________________________________
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