> On 2014 Nov 21, at 19:09, Rick Mann <rm...@latencyzero.com> wrote:
> 
> In an OS X app I have an NSTableView that binds to an array of Job objects. 
> I'd like to have a checkbox column that the user can check that indicates the 
> "active" job. There should be only one of these. Is there a way to bind the 
> value of that column to something other than the Job for that row, to handle 
> this?

This uniqueness of the “active” job seems to me like it belongs in your data 
model, not your view controller.

If this is a quickie project, implementing the uniqueness in an IBAction 
method, as discussed yesterday, is a quick fix that will work.

But for long-term projects that might in the future support, say, other views 
or scripting, Cocoa Bindings can be used to provide a more disciplined 
model-view-controller separation.  Cocoa Bindings do have a development cost, 
quite a bit of baggage, but you’re already using Cocoa Bindings in this project 
anyhow.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to