Instance Method

frameOfCellAtColumn:row:

Returns a rectangle locating the cell that lies at the intersection of the specified column and row.

Declaration

- (NSRect)frameOfCellAtColumn:(NSInteger)column row:(NSInteger)row;

Parameters

columnIndex

The index in the tableColumns array of the column containing the cell whose rectangle you want.

rowIndex

The index of the row containing the cell whose rectangle you want.

Return Value

A rectangle locating the cell that lies at the intersection of columnIndex and rowIndex. This method returns NSZeroRect if columnIndex or rowIndex is greater than the number of columns or rows in the table view.

Discussion

You can use this method to update a single cell more efficiently than sending the table view a reloadData message using reloadDataForRowIndexes:columnIndexes:

The result of this method is used in a drawWithFrame:inView: message to the table column's data cell. You can subclass and override this method to customize the frame of a particular cell. However, never return a frame larger than the default implementation returns.

The default frame is computed to have a height equal to the rectOfRow: for rowIndex, minus the half intercellSpacing height on the top and half on the bottom. The width of frame is equal to the with of the table column minus half the intercellSpacing width on the left, and half on the right.

See Also

Layout Support

userInterfaceLayoutDirection

The layout direction of the user interface.

- rectOfColumn:

Returns the rectangle containing the column at the specified index.

- rectOfRow:

Returns the rectangle containing the row at the specified index.

- rowsInRect:

Returns a range of indexes for the rows that lie wholly or partially within the vertical boundaries of the specified rectangle.

- columnIndexesInRect:

Returns the indexes of the table view’s columns that intersect the specified rectangle.

- columnAtPoint:

Returns the index of the column the specified point lies in.

- rowAtPoint:

Returns the index of the row the specified point lies in.

columnAutoresizingStyle

The table view’s column autoresizing style.

- sizeLastColumnToFit

Resizes the last column so the table view fits exactly within its enclosing clip view.

- noteNumberOfRowsChanged

Informs the table view that the number of records in its data source has changed.

- tile

Properly sizes the table view and its header view and marks it as needing display.

- sizeToFit

Sizes the table view based on a uniform column autoresizing style.

- noteHeightOfRowsWithIndexesChanged:

Informs the table view that the rows specified in indexSet have changed height.