Need guidance in table sorting
Need guidance in table sorting
- Subject: Need guidance in table sorting
- From: Yuhui <email@hidden>
- Date: Sun, 9 Mar 2003 22:55:00 -0600
I have a table in my application which I want to sort by column. I've
already designed the behind-the-scenes stuff, e.g. sorting methods, but
I'm stuck with the user-interface part and could use some assistance.
1. It seems that for each table column header, I have to use its
setAction: method (from the NSActionCell parent) to attach the sort
method to it at startup. Is this correct?
2. How do I put a little triangle indicator image in the header, like
those seen in Apple's apps (e.g. Mail, iTunes)? I know how to use
setIndicatorImage:inTableColumn, but where do I find the triangle image
itself? I searched the mailing list archives in Mamasam and found that
there used to be a method, [NSTableView _defaultTableHeaderSortImage],
to get the prebuilt image, but when I tried it, PB said that there was
no such method, so it seems that this undocumented feature doesn't work
any more. Is there an alternative? I'm currently attaching a triangle
(that I designed by myself) to the table's cornerView, but it seems
unelegant. I could modify my triangle to use as the indicator image,
but I keep thinking that this shouldn't be needed since something as
simple and essential as a triangle indicator image should be built into
NSTableView or one of its related classes.
Thanks in advance for your help!
Yuhui
_______________________________________________
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.