• 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: Binding a unique-selection checkbox in a table view?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Binding a unique-selection checkbox in a table view?
      • From: Rick Mann <email@hidden>
References: 
 >Binding a unique-selection checkbox in a table view? (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: Swift Interface vs Implementation
  • Next by Date: Re: CFRunLoopRef to NSRunLoop: how?
  • Previous by thread: Re: Binding a unique-selection checkbox in a table view?
  • Next by thread: Re: Binding a unique-selection checkbox in a table view?
  • Index(es):
    • Date
    • Thread