site_archiver@lists.apple.com Delivered-To: cocoa-dev@lists.apple.com @implementation GLInspectorController @end As I see it there are two options... either - (void *)observationInfo -- John Brownlow Deep Fried Films, Inc http://www.johnbrownlow.com http://www.pinkheadedbug.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/site_archiver%40lists.apple... I've seen this question asked before but not answered so I hope someone will step up. I have a document-based app which has several inspector windows which are independent of any particular document. The window controllers for these windows are owned and operated by the application's delegate. They update themselves to reflect whatever the current document is. I do this by (in IB) binding UI elements and NSArrayControllers to the respective window controller's -currentDocument method, implemented like this: - (NSDocument *)currentDocument { return [[NSDocumentController sharedDocumentController] currentDocument]; } However, when I close the document, I get an error to the effect that the document is being deallocated while there are still KVO observers registered. 1. Have the document explicitly check in and out with the application delegate and have all the inspector windows bind to an iVar in the application delegate. I think this would work but I would rather rely on the sharedDocumentManager to judge what is the current document. I don't see why the document itself should have to worry about it. 2. In the document's dealloc method, unbind all registered observers before [super dealloc]. Problem is, I don't know how to do this. NSKeyValueObserving declares a method that seems appropriate but the documentation is entirely opaque... it just says... Returns a pointer that identifies information about all of the observers that are registered with the receiver, the options that were used at registration-time, etc. The default implementation of this method retrieves the information from a global dictionary keyed by the receiver’s pointers. So what is the best practice for binding inspector windows to the current document?? This email sent to site_archiver@lists.apple.com