• 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
finding sort arrows for NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

finding sort arrows for NSTableView


  • Subject: finding sort arrows for NSTableView
  • From: Jeff Gilbert <email@hidden>
  • Date: Tue, 27 Nov 2001 22:12:46 -0600

I am looking for the up and down sort arrows used in table views like Mail and the Finder. After searching the archives, I found the following code snippet to create a local tiff image of the arrows:

[[[NSTableView _defaultTableHeaderSortImage] TIFFRepresentation] writeToFile: @"/tmp/sort-up.tiff" atomically: YES];
[[[NSTableView _defaultTableHeaderReverseSortImage] TIFFRepresentation] writeToFile: @"/tmp/sort-down.tiff" atomically: YES];

Is this still the recommended approach?

This works in X 10.1.1. However, there will be a problem if the "default" image changes in the future and I am still using the image I created in the past.

Is it "dangerous" to just do:

[table setIndicatorImage:[NSTableView _defaultTableHeaderSortImage] inTableColumn:[table tableColumnWithIdentifier:@"columnID"]];

so that I always get the current image? Most other apps (e.g. Mail) don't seem to actually store a tiff of the arrows in their resources, so I assume that they are obtaining the images at runtime. If so, is there an Apple-sanctioned approach for getting the images at runtime?

thanks,
Jeff Gilbert


  • Follow-Ups:
    • Re: finding sort arrows for NSTableView
      • From: Chuck Pisula <email@hidden>
  • Prev by Date: Re: Finding Glyphs for String
  • Next by Date: Re: XML and NSCoder
  • Previous by thread: Re: NSURL/NSURLHandle and caching
  • Next by thread: Re: finding sort arrows for NSTableView
  • Index(es):
    • Date
    • Thread