• 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: sort an nstablecolumn to button cell state?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >sort an nstablecolumn to button cell state? (From: Michael Hanna <email@hidden>)

  • Prev by Date: Re: NSOutlineView auto expand threshold
  • Next by Date: Re: Scripting Bridge Strange Pauses
  • Previous by thread: sort an nstablecolumn to button cell state?
  • Next by thread: bindings and NSNumberFormatter, enforcing min/max values
  • Index(es):
    • Date
    • Thread