Bindings on custom objects
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