NSTableView pre-select column sort
NSTableView pre-select column sort
- Subject: NSTableView pre-select column sort
- From: Peer Allan <email@hidden>
- Date: Sat, 17 Jan 2004 20:35:02 -0600
Hi,
I have been working on this all day and I can't find a solution. I have a
NSTableView that uses the new Panther sorting API (NSSortDescriptor) to sort
the columns.
The issue I am fighting with is having a column pre-selected with the
indicator image and proper sort order when the program launches. I want it
to behave like the Finder in that when you click on a column the sort column
switches to that column and a second click reverses the sort. This is what
is happening in my app:
Initial click (on "name" column) - selects column and shows indicator image
Second click (on "name" column) - switches indicator image, no sorting
change
Third click (on "name" column) - switches indicator image, resorts "name"
column
Fourth click (on "points column) - selects column, resorts "name" column
Fifth click (on "points column) - switches indicator image, resorts "points"
column
Sixth click (on "points" column) - switches indicator image, resorts
"points" column
Seventh click (on "name" column) - selects column, resorts "points" column
Eighth click (on "name" column) - switches indicator image, resorts "name"
column
...and so on.
I assume that all I need to do is set the initial sort description for the
table view, but I haven't been able to do it. Any help would be
appreciated.
Thanks
Peer
---------------------------
Weiler's Law
Nothing is impossible to the person who doesn't have to do it.
_______________________________________________
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.