• 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: NSTableView: use sorting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView: use sorting


  • Subject: Re: NSTableView: use sorting
  • From: Hank Heijink <email@hidden>
  • Date: Mon, 27 Nov 2006 10:12:56 -0500

In the method you mention, you should use -sortUsingDescriptors: with the [tableView sortDescriptors] as its argument on your array/set/ whatever you use to store your table data. The compare: method of the appropriate class will be called automatically.

See http://developer.apple.com/documentation/Cocoa/Conceptual/ SortDescriptors/

Hank

On Nov 27, 2006, at 7:43 AM, Simone Molendini wrote:

I've read several documents on this topic (also from archives of this
list), but I havent solved the following problem still.

I have a NSTableView with several columns, one of them, on the IB, I wrote:
Identifier: Title
Sort Key: Title
Sort Selector: compare:
Sort Order: Ascending


Contentent of this column's NSCell is a NSTextField, and "Title" is
the key of each row's NSMutableDictionary.

Everything is ok but... the fact that that column is not sorted (but
the fact that I see "up" and "down" rows at its header).

In the docs I know that I should write something at the:
- (void)tableView:(NSTableView *)aTableView
sortDescriptorsDidChange:(NSArray *)oldDescriptors

but I have problems with associating the "compare:" selector in this method.

Could someone help me?

Thanks,
Demon
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


Hank Heijink www.hankheijink.com email@hidden


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >NSTableView: use sorting (From: "Simone Molendini" <email@hidden>)

  • Prev by Date: Smart sort
  • Next by Date: Re: Smart sort
  • Previous by thread: NSTableView: use sorting
  • Next by thread: nsoutlineview selected objects using the concept of nstreecontroller
  • Index(es):
    • Date
    • Thread