NSTableColumn Mac OS X 10.0

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.


@interface NSTableColumn : NSObject
 // Initializers
   - (id)initWithIdentifier:(id)identifier;
 // Accessor Methods
   - (void)setTableView:(NSTableView *)tableView;
   - (NSTableView *)tableView;
   - (void)setIdentifier:(id)identifier;
   - (id)identifier;
   - (void)setResizable:(BOOL)flag;
   - (void)setMinWidth:(float)minWidth;
   - (float)minWidth;
   - (void)setHeaderCell:(NSCell *)cell;
   - (id)headerCell;
   - (void)setDataCell:(NSCell *)cell;
   - (id)dataCell;
   - (void)setMaxWidth:(float)maxWidth;
   - (float)maxWidth;
   - (void)setWidth:(float)width;
   - (float)width;
   - (void)setEditable:(BOOL)flag;
 // Instance Methods
   - (id)dataCellForRow:(int)row;
   - (BOOL)isEditable;
   - (BOOL)isResizable;
   - (void)sizeToFit;

    Part II: API Quick Reference
    Chapter 13. Foundation Classes