rowView(atRow:makeIfNecessary:)
Returns a row view at the specified index, creating one if necessary.
Declaration
func rowView(atRow row: Int, makeIfNecessary: Bool) -> NSTableRowView?Parameters
Return Value
An instance, or subclass, of NSTableRowView. Returning nil is also valid if makeIfNecessary is false and the view did not exist.
Discussion
This method first attempts to return a currently displayed view in the visible area. If there is no visible view, and makeIfNecessary is true, a prepared temporary view is returned. If makeIfNecessary is false, and the view is not visible, nil is returned.
In general, makeIfNecessary should be true if you require a resulting view, and false if you want to update properties on a view only if it is available (generally this means it is visible).
An exception is thrown if row falls outside of the number of rows in the table (numberOfRows). The returned result should generally not be held onto for longer than the current run loop cycle. It’s better to call rowView(atRow:makeIfNecessary:) whenever a view is required.