• 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: Tricky binding and continuous update problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Tricky binding and continuous update problem (From: Chris Idou <email@hidden>)

  • Prev by Date: Re: Problems with repetetive execution of netstat using NSTask and NSTimer
  • Next by Date: Re: Tricky binding and continuous update problem
  • Previous by thread: Tricky binding and continuous update problem
  • Next by thread: Re: Tricky binding and continuous update problem
  • Index(es):
    • Date
    • Thread