• 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
Re: Unregistering KVO observers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unregistering KVO observers


  • Subject: Re: Unregistering KVO observers
  • From: Hal Mueller <email@hidden>
  • Date: Thu, 17 Apr 2008 21:01:41 -0700

Look at Malcolm Crawford's Graphics Bindings example, which contains among other things two methods on GraphicsView to start and stop observation when an object of that class is created or destroyed.
http://homepage.mac.com/mmalc/CocoaExamples/controllers.html


I use -removeObserver:forKeyPath: for each of the keypath notifications I have requested, and then I count on the superclass's dealloc method to take care of its own keypath notifications. You can also use -removeObserver: but that seems like a blunt instrument to me, especially since I don't know what the superclass is counting on.

It would help to see your dealloc and close methods, especially if you think you're having trouble with a notification that you didn't register for.

Hal

_______________________________________________

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: Steve Nicholson <email@hidden>
References: 
 >Unregistering KVO observers (From: Steve Nicholson <email@hidden>)

  • Prev by Date: Re: @dynamic and Programmatic Access to Setters
  • Next by Date: Re: @dynamic and Programmatic Access to Setters
  • Previous by thread: Unregistering KVO observers
  • Next by thread: Re: Unregistering KVO observers
  • Index(es):
    • Date
    • Thread