NSTableHeaderCell Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AppKit.framework
Availability
Available in OS X v10.0 and later.
Companion guide
Declared in
NSTableHeaderCell.h

Overview

The NSTableHeaderCell class is used by an NSTableHeaderView instance to draw the content of the column headers. This specific subclass is responsible for drawing the sort indicators.

Subclasses of the NSTableHeaderCell class can override the drawInteriorWithFrame:inView:, editWithFrame:inView:editor:delegate:event:, and highlight:withFrame:inView: methods to change the way headers appear. See the NSCell class specification for information on overriding these methods.

See the NSTableView Class Reference and NSTableHeaderCell Class Reference for more information.

Tasks

Drawing Sorting Indicators

Instance Methods

drawSortIndicatorWithFrame:inView:ascending:priority:

Draws a sorting indicator given a cell frame contained inside a view.

- (void)drawSortIndicatorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView ascending:(BOOL)ascending priority:(NSInteger)priority
Parameters
cellFrame

The cell frame.

controlView

The control view.

ascending

If YES the sort indicator is drawn as ascending; otherwise it is drawn as descending.

priority

If priority is 0, this is the primary sort indicator.

Discussion

Override this method to customize the sorting user interface.

Availability
  • Available in OS X v10.3 and later.
Declared In
NSTableHeaderCell.h

sortIndicatorRectForBounds:

Returns the location to display the sorting indicator given theRect.

- (NSRect)sortIndicatorRectForBounds:(NSRect)theRect
Parameters
theRect

A cell rectangle.

Return Value

The rectangle within theRect that should contain the sorting indicator.

Availability
  • Available in OS X v10.3 and later.
Declared In
NSTableHeaderCell.h