Contents

view(atColumn:row:makeIfNecessary:)

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

Declaration

func view(atColumn column: Int, row: Int, makeIfNecessary: Bool) -> NSView?

Parameters

  • column:

    The index of the column in the Tablecolumns array.

  • row:

    The row index.

  • makeIfNecessary:

    True if a view is required, False 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 true, a prepared temporary view is returned. If makeIfNecessary is false, and the view is not available, nil will be returned.

In general, makeIfNecessary should be true if you require a resulting view, and false 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