Re: NSTableView: use sorting
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