Instance Method

tableView:sizeToFitWidthOfColumn:

Asks the delegate to provide custom sizing behavior when a column’s resize divider is double clicked.

Declaration

- (CGFloat)tableView:(NSTableView *)tableView sizeToFitWidthOfColumn:(NSInteger)column;

Parameters

tableView

The table view that sent the message.

column

The index of the column.

Return Value

The width of the specified column.

Discussion

By default, NSTableView iterates every row in the table, accesses a cell via preparedCellAtColumn:row:, and requests the cellSize to find the appropriate largest width to use.

For accurate results and performance, it’s recommended that this method is implemented when using large tables. By default, large tables use a Monte Carlo simulation instead of iterating every row.

See Also

Setting Row and Column Size

- tableView:heightOfRow:

Asks the delegate for the height of the specified row.