• 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
Need guidance in table sorting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Need guidance in table sorting
      • From: Paul Ferguson <email@hidden>
    • Re: Need guidance in table sorting
      • From: Stéphane Sudre <email@hidden>
  • Prev by Date: Re: NSTask / forking in sub-process / Problem?
  • Next by Date: Need guidance in table sorting
  • Previous by thread: Re: Object can't alloc itself
  • Next by thread: Re: Need guidance in table sorting
  • Index(es):
    • Date
    • Thread