• 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: How to de-register value observers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to de-register value observers


  • Subject: Re: How to de-register value observers
  • From: Tron Thomas <email@hidden>
  • Date: Mon, 03 Sep 2007 13:53:18 -0700

Nick Zitzmann wrote:

On Sep 3, 2007, at 12:29 PM, Tron Thomas wrote:

removeObserver:forKeyPath: is the equivalent for addObserver:forKeyPath:options:context, which is call by the object that wants to observe the value.

Since the observing object registers itself, it seems that the same object should de-register itself as well. I'm not sure how every registered object is supposed to know that the window controller is deallocating itself so they can de-register themselves.

The first thing I would try is using NSNotificationCenter...

Nick Zitzmann
<http://www.chronosnet.com/>
I'm not exactly sure how you are suggesting that NSNotificationCenter would be used.

One idea I have every object that registers for a binding the controller would also register for a notification. Before the controller deallocates, it would post a notification informing all the observers they should de-register.

I don't know if it is possible that the controller would attempt to deallocate before all the registered object has responded to the registered notification.

Perhaps there is a different way you are suggesting that NSNotificationCenter would be used.

_______________________________________________

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


References: 
 >How to de-register value observers (From: Tron Thomas <email@hidden>)
 >Re: How to de-register value observers (From: Nick Zitzmann <email@hidden>)
 >Re: How to de-register value observers (From: Tron Thomas <email@hidden>)
 >Re: How to de-register value observers (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: How to de-register value observers
  • Next by Date: Re: Adding to an applications menu.
  • Previous by thread: Re: How to de-register value observers
  • Next by thread: Re: How to de-register value observers
  • Index(es):
    • Date
    • Thread