Key value observer set up in IB not removed
Key value observer set up in IB not removed
- Subject: Key value observer set up in IB not removed
- From: "Doug Knowles" <email@hidden>
- Date: Thu, 22 Feb 2007 08:46:09 -0500
I'm getting the following message when I close a document in my app:
"An instance 0x327460 of class SLNDocument is being deallocated while
key value observers are still registered with it. Break on
_NSKVODeallocateLog to start debugging."
Printing out the KVO information on the document shows a single observer...
<NSKeyValueObservance: Observer: 0x35ce40, Key path:
unassignedItemCount, Include old: NO, Include new: NO, Context:
0x376c30, Property: 0x35cf70>
...which is, as I expected, a text field in an information window
bound the window controller with the key path
"document.unassignedItemCount". (This is one of the first cases where
I've used a multi-segment key path in IB.)
The information window in question is owned by a window controller in
turned owned by the document; the window is closed, and set to be
released on close. I would have expected that the KVO relationship
would be broken when the window is torn down, but apparently not.
Do I have to (or can I) do something explicit in code to clean up the
binding I set up in IB?
In the meantime, is this dangerous to ignore? I know I want to clean
it up eventually, but I have other fish to fry at the moment...
On a related note, setting a breakpoint on _NSKVODeallocateLog is
doing nothing; is it supposed to, or do I need to define a variable to
get it to break?
TIA,
Doug Knowles
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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