Re: Binding a unique-selection checkbox in a table view?
Re: Binding a unique-selection checkbox in a table view?
- Subject: Re: Binding a unique-selection checkbox in a table view?
- From: Jerry Krinock <email@hidden>
- Date: Sat, 22 Nov 2014 06:17:44 -0500
> On 2014 Nov 21, at 19:09, Rick Mann <email@hidden> 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 (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