• 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: Cocoa Bindings - removeObserver if I know the observed instance
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa Bindings - removeObserver if I know the observed instance


  • Subject: Re: Cocoa Bindings - removeObserver if I know the observed instance
  • From: Mike Abdullah <email@hidden>
  • Date: Wed, 15 Nov 2006 22:40:51 +0000

This is a good point - I originally thought it was just a general question about unbinding programmatically, it took me a while to discover that method!

So, I'd say the answer is "no" there's no way to do this. The whole point of KVO and therefore bindings is that the observed object doesn't care who is observing it, and thereby doesn't know.

However, if you've set it up in Interface Builder, I see no reason why one can't make an outlet from a controller object to the interface item and use the -unbind: method on that.

The only other real possibility I see (and this is a very bad one) is to manually search the view hierarchy in the nib looking for an object that is bound to the observed one.

Mike.

On 15 Nov 2006, at 19:59, Matt Neuburg wrote:

On Wed, 15 Nov 2006 17:12:18 +0000, Mike Abdullah <email@hidden>
said:
the unbind: method?

Could you show some code, Mike? Remember, Sam's presupposition is that we
know the observed instance - not the observer (to whom "bind" was originally
sent). m.




On 15 Nov 2006, at 16:36, Samuel DeVore wrote:

If I have set up the bindings for a set of ui elements in interface
builder, is there a way to remove the bindings from the code side
if I know the observed instance?

-- matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/> A fool + a tool + an autorelease pool = cool! AppleScript: the Definitive Guide - Second Edition! <http://www.amazon.com/gp/product/0596102119>




_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Cocoa Bindings - removeObserver if I know the observed instance
      • From: Kay Roepke <email@hidden>
References: 
 >Re: Cocoa Bindings - removeObserver if I know the observed instance (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: CoreData, reset a persistent store
  • Next by Date: CoreData, reset a persistent store
  • Previous by thread: Re: Cocoa Bindings - removeObserver if I know the observed instance
  • Next by thread: Re: Cocoa Bindings - removeObserver if I know the observed instance
  • Index(es):
    • Date
    • Thread