Name

NSTableColumn — Mac OS X 10.0

Synopsis

This class represents a column in an NSTableView. In particular, NSTableColumn stores display attributes of the table column, such as the display width, whether the table column may be resized, and whether it is editable.

Every column in a table has a unique identifier, which is accessed with the methods setIdentifier: and identifier.

Associated with a table column object are two NSCells: the header cell and the data cell. The header cell is responsible for the appearance of the table column header. To access the table column’s header cell, use the methods setHeaderCell: and headerCell.

The data cell of a table column determines how data in the column is displayed. By default the data cell is an instance of NSTextFieldCell, which provides for displayed and editing text data. However, you could change the data cell of a table column to display controls other than a text field. For example, if you wanted to display Boolean information in your table column, you could set the data cell to an instance of NSButtonCell that is configured as a checkbox. If you wanted a column of slider controls, you could set the data cell of the column to an instance of NSSliderCell. To access the data cell use the methods setDataCell: and dataCell.

image with no caption

@interface NSTableColumn : NSObject
                                  // Initializers
   - (id)initWithIdentifier:(id)identifier;
                                  // Accessor Methods ...

Get Cocoa in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.