Class

NSTableColumn

The display characteristics and identifier for a column in a table view.

Declaration

@interface NSTableColumn : NSObject

Overview

A table column object determines the width (including the maximum and minimum widths) of its column in the table view and specifies the column’s resizing and editing behavior. A table column stores two cell objects: the header cell, which is used to draw the column header, and the data cell, which is used to draw the values for each row. In a cell-based table, you can control the display of the column by specifying subclasses of NSCell to use and by setting the font and other display characteristics for these cells. For example, you can use an NSTextFieldCell to display string values or substitute an NSImageCell to display pictures.

Topics

Creating a Table Column

- initWithIdentifier:

Initializes a newly created table column with a string identifier.

Setting the Table View

tableView

The table view that contains the table column.

Controlling Size

width

The table column’s width, in points.

minWidth

The table column’s minimum width, in points.

maxWidth

The table column’s maximum width, in points.

resizingMask

The table column’s resizing mask.

- sizeToFit

Resizes the table column to fit the width of its header cell.

Setting the Header

title

The title of the table column’s header.

headerCell

The cell used to draw the table column’s header.

Setting the Identifier

identifier

The identifier string for the table column.

Controlling Editability in a Cell-Based Table

editable

A Boolean that indicates whether a cell-based table’s column cells are user editable.

Sorting

sortDescriptorPrototype

The table column’s sort descriptor prototype.

Setting Column Visibility

hidden

A Boolean that indicates whether the table column is hidden.

Setting Tooltips

headerToolTip

The string that’s displayed in a help tag over the table column header.

Deprecated Methods

- isResizable

Returns whether the column is resizable.

Deprecated
- setResizable:

Sets whether the user can resize the receiver in its NSTableView.

Deprecated
dataCell

The cell prototype used by the table column to draw individual cells.

Deprecated
- dataCellForRow:

Returns the cell object used to display values in the specified row of the table column.

Deprecated

Constants

Resizing Modes

These constants specify the resizing modes for a table column. The values are used to set the resizingMask property.

Initializers

Relationships

Inherits From

See Also

Rows and Columns

NSTableHeaderView

An object that draws headers over a table view's columns and handles mouse events in those headers.

NSTableHeaderCell

An object that a table header view uses to draw the content of the column headers.

NSTableRowView

The view shown for a row in a table view.

NSTableViewRowAction

A single action to present when the user swipes horizontally on a table row.