Instance Method

viewAtColumn:row:makeIfNecessary:

Returns a view at the specified row and column indexes, creating one if necessary.

Declaration

- (__kindof NSView *)viewAtColumn:(NSInteger)column row:(NSInteger)row makeIfNecessary:(BOOL)makeIfNecessary;

Parameters

column

The index of the column in the tableColumns array.

row

The row index.

makeIfNecessary

YES if a view is required, NO if you want to update properties on a view, if one is available.

Return Value

An instance of NSView.

Discussion

This method first attempts to return an available view, which is generally in the visible area. If there is no available view, and makeIfNecessary is YES, a prepared temporary view is returned. If makeIfNecessary is NO, and the view is not available, nil will be returned.

In general, makeIfNecessary should be YES if you require a resulting view, and NO if you only want to update properties on a view only if it is available (generally this means it is visible).

An exception will be thrown if row is not within the numberOfRows. The returned result should generally not be held onto for longer than the current run loop cycle. Instead they should re-query the table view for the row view.

See Also

Creating Views to Display

- makeViewWithIdentifier:owner:

Returns a new or existing view with the specified identifier.

- rowViewAtRow:makeIfNecessary:

Returns a row view at the specified index, creating one if necessary.