• 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
Bindings on custom objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bindings on custom objects


  • Subject: Bindings on custom objects
  • From: "Daniel Angermeier" <email@hidden>
  • Date: Wed, 30 May 2007 00:21:37 +0200

Hi,

I've bound object A to object B programmatically.
Both inherit directly from NSObject (they are non view or controller classes).
and both are KVC compliant for the given properties.
(self = objectA)

[self bind:@"currentValue" toObject:objectB withKeyPath:aKeyPath options:nil];

However the binding only works in one direction, that is
if I change the key path of object B, object A updates its bound
property correctly,
however if I change the given key on object A, the change is not propagated to
object B.

Now, if I change the order of the binding, I am getting an undefined
key exception:
[objectB bind:aKeyPath toObject:self withKeyPath:@"currentValue" options:nil];

can the bind:toObject:withKeyPath:options method only be invoked on
NSView (and subclasses) objects ?

Could somebody please tell me what I am obviously doing wrong in the
code above ?

Any help would be greatly appreciated.

Many thanks in advance!

Daniel
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: Bindings on custom objects
      • From: Yann Bizeul <email@hidden>
  • Prev by Date: Re: How to draw a rectangle around a (graph) view?
  • Next by Date: NSTableView's disappearing horizontal scrollbar
  • Previous by thread: Pasteboard issue
  • Next by thread: Re: Bindings on custom objects
  • Index(es):
    • Date
    • Thread