Re: Just when I thought I understood bindings.
Re: Just when I thought I understood bindings.
- Subject: Re: Just when I thought I understood bindings.
- From: Negm-Awad Amin <email@hidden>
- Date: Thu, 9 Oct 2008 10:48:11 +0200
Am Do,09.10.2008 um 02:46 schrieb Tim Isted:
Did you setup the bindings using Interface Builder or
programatically? If programatically, they work in only one direction
so you need to call
[object1 bind:@"value" toObject:object2
withKeyPath:@"whateverPathForKeyIs" options:nil]; and
[object2 bind:@"value" toObject:object1
withKeyPath:@"whateverPathForKeyIs" options:nil];
Otherwise, make sure you're content object is KVC/KVO compliant etc.
Because this is not the first "IB magic" mail:
The IB cannot do something else. The IB writes the programmer's
settings to a file. So he does nothing in your running program.
The nib-loader reads that file and "translates" this into code. Since
the nib-loader is a "normal piece of code" it can do what you can do.
And you can do, what the nib-loader can do. (okay, maybe there are
undocumentated features …)
Cheers
Tim
On 9 Oct 2008, at 01:21, Chris Idou wrote:
I've got an NSObjectController controlling an object. This content
object's properties are bound to various fields on my screen.
It seems that the bindings are only working in one direction.
Editing the fields updates the object, but programmatically
updating the object doesn't update the gui.
I've added observers to my fields, and they are definitely
notifying of changes correctly.
I haven't made much use of NSObjectController before. Can anybody
think what I might be doing wrong?
_______________________________________________
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
Amin Negm-Awad
email@hidden
_______________________________________________
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