• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Unregistering KVO observers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Unregistering KVO observers
      • From: Hal Mueller <email@hidden>
  • Prev by Date: Re: -charactersIgnoringModifiers and the shift key
  • Next by Date: adding Quicklook preview to my app
  • Previous by thread: Re: Determining which sheet closed with panels in separate nibs
  • Next by thread: Re: Unregistering KVO observers
  • Index(es):
    • Date
    • Thread