Re: sort an nstablecolumn to button cell state?
Re: sort an nstablecolumn to button cell state?
- Subject: Re: sort an nstablecolumn to button cell state?
- From: Keary Suska <email@hidden>
- Date: Fri, 17 Sep 2010 08:33:53 -0600
On Sep 16, 2010, at 2:09 PM, Michael Hanna wrote:
> I have an NSTableColumn in an NSTableView that has only an
> NSButtonCell(checkbox). When the user clicks the table column header I'd
> like it to sort the table items according to whether or not the checkbox is
> selected. so the end result is that all checked items are grouped
> together(and all unchecked are grouped together).
>
> Any suggestions on how to do this? I'm aware of the the Sort Key field in
> the Attributes inspector, but it's not obvious to me whether or not this
> will help. I've also set the sort descriptors on the tableview's array
> controller but selection state isn't a property but is derived from from
> other information.
The "state" needs to be a property of the individual model object or accessible via a key path. AFAIK, there is no other way when you are using bindings/NSArrayController, unless you don't allow the NSArrayController to handle sorting (and use NSTableView delegation), but I have never tried that so I can't say whether it will work.
HTH,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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