finding sort arrows for NSTableView
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