Mac Developer Library

Developer

AppKit Framework Reference NSTableRowView Class Reference

Options
Deployment Target:

On This Page
Language:

NSTableRowView

The NSTableRowView class is the view shown for a row in an NSTableView. It is responsible for displaying attributes associated with the row, including the selection highlight, and group row look.

Inheritance


Import Statement


import AppKit @import AppKit;

Availability


Available in OS X v10.7 and later.
  • Determines whether the row will draw with the alternate or secondary color (unless overridden).

    Declaration

    Swift

    var emphasized: Bool

    Objective-C

    @property(getter=isEmphasized) BOOL emphasized

    Discussion

    When emphasized is YEStrue, the view will draw with the alternateSelectedControlColor defined by NSColor. When NOfalse it will use the secondarySelectedControlColor defined by NSColor.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Specifies how the subviews should draw. (read-only)

    Declaration

    Swift

    var interiorBackgroundStyle: NSBackgroundStyle { get }

    Objective-C

    @property(readonly) NSBackgroundStyle interiorBackgroundStyle

    Discussion

    This value is dynamically computed based on the set of properties set for the NSTableRowView.

    Subclassers can override this value when they draw differently based on the currently displayed properties.

    This property can also be set to determine the color a subview should use. See NSBackgroundStyle for supported values.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • floating floating Property

    Specifies whether the row is drawn using the floating style.

    Declaration

    Swift

    var floating: Bool

    Objective-C

    @property(getter=isFloating) BOOL floating

    Discussion

    Floating is a temporary attribute that is set when a particular group row is actually floating above other rows. The state may change dynamically based on the position of the group row. Drawing may be different for rows that are currently 'floating'.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Specifies whether this row view is a group row.

    Declaration

    Swift

    var groupRowStyle: Bool

    Objective-C

    @property(getter=isGroupRowStyle) BOOL groupRowStyle

    Discussion

    When YEStrue this row is a group row and will draw appropriately.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Returns the number of columns represented by views in the table row view. (read-only)

    Declaration

    Swift

    var numberOfColumns: Int { get }

    Objective-C

    @property(readonly) NSInteger numberOfColumns

    Discussion

    The number of columns may not be equal to the number of columns in the enclosing NSTableView, if this row view is a group style and has a single view that spans the entire width of the row.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • The background color of the row.

    Declaration

    Swift

    @NSCopying var backgroundColor: NSColor

    Objective-C

    @property(copy) NSColor *backgroundColor

    Discussion

    The property defaults to the table view’s backgroundColor, unless usesAlternatingRowBackgroundColors is set to YEStrue. In that case, the colors alternate, and are automatically updated as required by insertions and deletions.

    The value of the background color can be customized in the NSTableViewDelegate method tableView:didAddRowView:forRow:. The property is animatable.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Draws the background of the row in the rectangle.

    Declaration

    Swift

    func drawBackgroundInRect(_ dirtyRect: NSRect)

    Objective-C

    - (void)drawBackgroundInRect:(NSRect)dirtyRect

    Parameters

    dirtyRect

    The rectangle that requires drawing.

    Discussion

    Overriding this method allows an application to draw a custom background for a table row view.

    By default, this method draws the background color or group row style as appropriate for the row. This method also draws the “below look” for a drop target if targetForDropOperation is YEStrue.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Draws the row’s dragging destination feedback when the entire row is a drop target.

    Declaration

    Swift

    func drawDraggingDestinationFeedbackInRect(_ dirtyRect: NSRect)

    Objective-C

    - (void)drawDraggingDestinationFeedbackInRect:(NSRect)dirtyRect

    Parameters

    dirtyRect

    The rectangle that requires drawing.

    Discussion

    Overriding this method allows an application to draw custom dragging destination feedback when the entire row is a drop target.

    This method only is called if targetForDropOperation is YEStrue, and is only drawn based on the properties set, such as the group row style.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Draws the selected row.

    Declaration

    Swift

    func drawSelectionInRect(_ dirtyRect: NSRect)

    Objective-C

    - (void)drawSelectionInRect:(NSRect)dirtyRect

    Parameters

    dirtyRect

    The rectangle that requires drawing.

    Discussion

    This method is only called if the selection should be drawn.

    The selection will automatically be alpha-blended if the selection is animating in or out.

    The default selection drawn is dependent on the selectionHighlightStyle.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Draws the horizontal separator between table rows.

    Declaration

    Swift

    func drawSeparatorInRect(_ dirtyRect: NSRect)

    Objective-C

    - (void)drawSeparatorInRect:(NSRect)dirtyRect

    Parameters

    dirtyRect

    The rectangle that requires drawing.

    Discussion

    By default, the separator is only drawn if the enclosing table's gridStyleMask is set to include a horizontal separator.

    The separator should be drawn at the bottom of the row view, indicating a separation from this row and the next.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Provides access to the given view at a particular column.

    Declaration

    Swift

    func viewAtColumn(_ column: Int) -> AnyObject?

    Objective-C

    - (id)viewAtColumn:(NSInteger)column

    Parameters

    column

    The index of the column.

    Return Value

    The view for the specified column.

    Discussion

    This is the only way to access cell views after the row view has been removed from the table.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.