• 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: Sorting NSTableView on two keys
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sorting NSTableView on two keys


  • Subject: Re: Sorting NSTableView on two keys
  • From: Scott Anguish <email@hidden>
  • Date: Fri, 11 Nov 2005 01:14:44 -0500

in IB, the only option you have is to bind an array to the sortDescriptors binding for the array controller

the sort descriptors in the table view inspector are at the tableview level, likely not what you want. there isn't really a way to specify the sort order for multiple columns, only that key "x" is the key that is used when sorting that column by clicking in the tablecolumn header



On Nov 11, 2005, at 1:06 AM, Trygve Inda wrote:


On Nov 11, 2005, at 12:35 AM, Trygve Inda wrote:

How can I sort an NSTableView (controlled by an NSArrayController)
on two
keys?

E.g. lastName and then firstName so I get

Bob Smith
Jon Smith


supply the array controller an array of sort descriptors that specifies lastName, and then firstName..


Sort Descriptors

http://developer.apple.com/documentation/Cocoa/Reference/Foundation/
ObjC_classic/Classes/NSSortDescriptor_index.html

setSortDescriptors method on NSArrayController

http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSArrayController.html#//
apple_ref/doc/uid/20002042-BCIGGDHD

I am trying to do this within IB if possible, but each column in my table
only allows one sortKey. I'd like it set so that if I sort by lastName by
clicking the column header, the list sorts, but also keeps the other column
(firstNam) sorted within each lastname.


Possible?

Thx.

Trygve


--
"William Cheeseman ... is said not to be a doofus in real life." - Roger Ebert, Chicago Sun-Times Online


Scott Anguish
email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Sorting NSTableView on two keys
      • From: Trygve Inda <email@hidden>
References: 
 >Re: Sorting NSTableView on two keys (From: Trygve Inda <email@hidden>)

  • Prev by Date: Re: Sorting NSTableView on two keys
  • Next by Date: Re: Sorting NSTableView on two keys
  • Previous by thread: Re: Sorting NSTableView on two keys
  • Next by thread: Re: Sorting NSTableView on two keys
  • Index(es):
    • Date
    • Thread