Re: Need guidance in table sorting (Yuhui)
Re: Need guidance in table sorting (Yuhui)
- Subject: Re: Need guidance in table sorting (Yuhui)
- From: Francisco Tolmasky <email@hidden>
- Date: Sun, 9 Mar 2003 22:30:47 -0800
1. When I sort columns I use the table delegate method:
- (void)tableView: (NSTableView *)aTableView
didClickTableColumn: (NSTableColumn *)aTableColumn;
{
if(aTableColumn==lastColumnToBeClicked)
{
//reverse order of sort...
MySortDirection= !MySortDirection
}
if([[aTableColumn identifier] isEqualTo: @"Some Table Identifier"])
{
//sort code...
MySortDirection= 1;
}
[aTableView setIndicatorImage: (MySortDirection?
[NSImage imageNamed: @"NSAscendingSortIndicator"]:
[NSImage imageNamed: @"NSDescendingSortIndicator"])
inTableColumn: aTableColumn];
}
2. Use these:
[NSImage imageNamed: @"NSAscendingSortIndicator"]
and
[NSImage imageNamed: @"NSDescendingSortIndicator"])
Francisco Tolmasky
email@hidden
http://users.adelphia.net/~ftolmasky
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.