• 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: Why aren't my bindings firing?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why aren't my bindings firing?


  • Subject: Re: Why aren't my bindings firing?
  • From: Ken Thomases <email@hidden>
  • Date: Sat, 28 Jun 2008 01:57:33 -0500

On Jun 28, 2008, at 1:30 AM, Charles Srstka wrote:

I guess the only question I still have then is: why did my example worke one-way in the first place? If the bindings are in a different namespace, shouldn't it have failed for lack of an exposed binding named "title" in the Bar object? Or is there a *little* magic going on here, just not going all the way?

That depends on how the bar class from your OP (or one of its superclasses) implemented bind:toObject:withKeyPath:options:. That code may not have checked the passed-in binding name, and may have unconditionally added itself as an observer of ivar_controller for the key path "selection.displayName". That would have guaranteed that bar would receive observeValueForKeyPath:ofObject:change:context: messages whenever foo's displayName property was changed in a KVO-conforming manner. (For example, if, in listing 2 of the how-it-works document, the check of the binding name against "angle" were omitted.)


Then, what happens next is up to bar's implementation of observeValueForKeyPath:ofObject:change:context:. If it blindly did [self setTitle:[object valueForKeyPath:keyPath]], then that would explain it. (For example, if, in listing 4, the test of context were omitted.)

Regards,
ken
_______________________________________________

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: Why aren't my bindings firing?
      • From: Charles Srstka <email@hidden>
References: 
 >Why aren't my bindings firing? (From: Charles Srstka <email@hidden>)
 >Re: Why aren't my bindings firing? (From: Ken Thomases <email@hidden>)
 >Re: Why aren't my bindings firing? (From: Charles Srstka <email@hidden>)
 >Re: Why aren't my bindings firing? (From: Ken Thomases <email@hidden>)
 >Re: Why aren't my bindings firing? (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: KVO Question -- Really Simple for Pros
  • Next by Date: NSExpression
  • Previous by thread: Re: Why aren't my bindings firing?
  • Next by thread: Re: Why aren't my bindings firing?
  • Index(es):
    • Date
    • Thread