Re: Tricky binding and continuous update problem
Re: Tricky binding and continuous update problem
- Subject: Re: Tricky binding and continuous update problem
- From: Jerry Krinock <email@hidden>
- Date: Tue, 6 Apr 2010 17:26:26 -0700
On 2010 Apr 06, at 16:36, Chris Idou wrote:
> If I turn off Continuously Update Value, it works sensibly,
Turn it off. Look at any of Apple's Sample Code. Also, Cocoa Design Rule #1: If something is off/on by default, don't change it unless you're knowingly doing something weird.
> albeit not as nice since you've got to exit the field to have everything in synch.
That's the way most apps work.
You did not mention using an array controller. To insure data integrity in case user tabs out, abruptly closes the window, etc., do not bind directly to the model. Instead, bind your text fields ("detail views") to an NSArrayController to which the table columns are also bound. As a matter of fact, if you didn't use an array controller, you'd better look at Apple's DepartmentAndEmployees sample code and be prepared for a little re-work. There may be a way to make it work without an array controller, but why bother?
The way I understand it, the NSArrayController superclass NSObjectController fulfills the same purpose of data integrity if you can't bind to an array controller, for example if you have an Inspector in another nib. NSObjectController seems like a heavy weight for this purpose, but it works. For an example of this, in DepartmentAndEmployees's MyDocument.nib, look at the NSObjectController named 'Department Controller'. It seems like it's useless but it's not.
Probably someone else can give a more in-depth explanation.
_______________________________________________
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