NSTableCellView Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in OS X v10.7 and later. |
| Declared in | NSTableCellView.h |
| Companion guides | |
Overview
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.
Tasks
Represented Object
-
objectValueproperty
Displayed Items
Getting and Setting the Background Style
-
backgroundStyleproperty
Getting and Setting the Row Size Style
-
rowSizeStyleproperty
Dragging Images
-
draggingImageComponentsproperty
Properties
backgroundStyle
This property is automatically set by the enclosing row view to let this view know what its background looks like.
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:.
Availability
- Available in OS X v10.7 and later.
Declared In
NSTableCellView.hdraggingImageComponents
Returns dragging images for the cell. (read-only)
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.
Availability
- Available in OS X v10.7 and later.
Declared In
NSTableCellView.himageView
Image displayed by the cell.
Discussion
This property is typically configured when the row is created in the NSTableViewDataSource protocol method tableView:viewForTableColumn:row:.
Availability
- Available in OS X v10.7 and later.
Declared In
NSTableCellView.hobjectValue
The object that represents the cell data.
Discussion
The objectValue is automatically set by the table when using bindings or is the object returned by the NSTableViewDataSource protocol method tableView:objectValueForTableColumn:row:.
Availability
- Available in OS X v10.7 and later.
See Also
-
– tableView:objectValueForTableColumn:row:(NSTableViewDataSource Protocol)
Declared In
NSTableCellView.hrowSizeStyle
Returns the row size style.
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.
Availability
- Available in OS X v10.7 and later.
Declared In
NSTableCellView.htextField
Text displayed by the cell.
Discussion
This property is typically configured when the row is created in the NSTableViewDataSource protocol method tableView:viewForTableColumn:row:.
Availability
- Available in OS X v10.7 and later.
Declared In
NSTableCellView.h© 2011 Apple Inc. All Rights Reserved. (Last updated: 2011-06-06)