Mac Developer Library

Developer

AppKit Framework Reference NSTableCellView Class Reference

Options
Deployment Target:

On This Page
Language:

NSTableCellView

The NSTableCellView class is a reusable container view shown for a particular cell in an NSTableView instance that uses rows for content. The imageView and textField properties are connected in Interface Builder. Additional properties can be added by subclassing NSTableCellView and adding the required properties and connecting them programmatically or in Interface Builder.

The objectValue is used when setting the value of the view cell by the tableView:objectValueForTableColumn:row: method in the NSTableViewDataSource. If you use your own custom view cells that are not based on NSTableCellView you should implement this property in order to be able to receive changes to cell values.

Inheritance


Import Statement


Swift

import AppKit

Objective-C

@import AppKit;

Availability


Available in OS X v10.7 and later.
  • This property is automatically set by the enclosing row view to let this view know what its background looks like.

    Declaration

    Swift

    var backgroundStyle: NSBackgroundStyle

    Objective-C

    @property NSBackgroundStyle backgroundStyle

    Discussion

    The property is automatically set by the enclosing NSTableRowView to let this view know what its background looks like. For instance, when the backgroundStyle is NSBackgroundStyleDark, the view should use a light text color.

    The default implementation automatically forwards calls to all subviews that implement setBackgroundStyle: or are an NSControl, which have NSCell classes that respond to setBackgroundStyle:.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Returns the row size style.

    Declaration

    Swift

    var rowSizeStyle: NSTableViewRowSizeStyle

    Objective-C

    @property NSTableViewRowSizeStyle rowSizeStyle

    Discussion

    The rowSizeStyle property is set by the NSTableView to its effectiveRowSizeStyle. The cell view will layout the textField and imageView based on the rowSizeStyle.

    A value of NSTableViewRowSizeStyleDefault should never be set on the cell view, as it is an appropriate value only for the table as it returns the effective row size style for the table.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Returns dragging images for the cell. (read-only)

    Declaration

    Swift

    var draggingImageComponents: [AnyObject] { get }

    Objective-C

    @property(readonly, strong) NSArray *draggingImageComponents

    Discussion

    The default implementation of this method returns an array of up to two NSDraggingImageComponent instances -- one for the imageView and another for the textField (unless the property is nil).

    These method can be subclassed and overridden to provide a custom set of NSDraggingImageComponent objects to create the drag image from this view.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.7 and later.