Mac Developer Library

Developer

AppKit Framework Reference NSTableView Class Reference

Options
Deployment Target:

On This Page
Language:

NSTableView

An NSTableView object displays data for a set of related records, with rows representing individual records and columns representing the attributes of those records. More...

Import Statement


import AppKit @import AppKit;

Availability


Available in OS X v10.0 and later.
  • Returns a new or existing view with the specified identifier.

    Declaration

    Swift

    func makeViewWithIdentifier(_ identifier: String, owner owner: AnyObject?) -> AnyObject?

    Objective-C

    - (id)makeViewWithIdentifier:(NSString *)identifier owner:(id)owner

    Parameters

    identifier

    The view identifier. Must not be nil.

    owner

    The owner of the NIB that may be loaded and instantiated to create a new view with the specified identifier.

    Return Value

    A view for the row.

    Discussion

    Typically, identifier is associated with a cell view that’s contained in a table’s nib file. When this method is called, the table view automatically instantiates the cell view with the specified owner, which is usually the table view’s delegate. (The owner is useful in setting up outlets and target/actions from the view.) Note that a cell view’s identifier must be the same as its table column’s identifier for bindings to work. If you’re using bindings, it’s recommended that you use the Automatic identifier setting in Interface Builder.

    This method may also return a reused view with the same identifier that is no longer available on screen. If a view with the specified identifier can’t be instantiated from the nib file or found in the reuse queue, this method returns nil.

    This method is usually called by the delegate in tableView:viewForTableColumn:row:, but it can also be overridden to provide custom views for the identifier. Note that awakeFromNib is called each time this method is called, which means that awakeFromNib is also called on owner, even though the owner is already awake.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Returns a row view at the specified index, creating one if necessary.

    Declaration

    Swift

    func rowViewAtRow(_ row: Int, makeIfNecessary makeIfNecessary: Bool) -> AnyObject?

    Objective-C

    - (id)rowViewAtRow:(NSInteger)row makeIfNecessary:(BOOL)makeIfNecessary

    Parameters

    row

    The row index.

    makeIfNecessary

    YEStrue if a view is required, NOfalse if you want to update properties on a view, if one is available.

    Return Value

    An instance, or subclass, of NSTableRowView. Returning nil is also valid if makeIfNecessary is NOfalse 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 YEStrue, a prepared temporary view is returned. If makeIfNecessary is NOfalse, and the view is not visible, nil is returned.

    In general, makeIfNecessary should be YEStrue if you require a resulting view, and NOfalse 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 is not within the numberOfRows. The returned result should generally not be held onto for longer than the current run loop cycle. It’s better to call rowViewAtRow:makeIfNecessary: whenever a view is required.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

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

    Declaration

    Swift

    func viewAtColumn(_ column: Int, row row: Int, makeIfNecessary makeIfNecessary: Bool) -> AnyObject?

    Objective-C

    - (id)viewAtColumn:(NSInteger)column row:(NSInteger)row makeIfNecessary:(BOOL)makeIfNecessary

    Parameters

    column

    The index of the column in the tableColumns array.

    row

    The row index.

    makeIfNecessary

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

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

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Sets the receiver’s data source to the specified object.

    Declaration

    Swift

    func setDataSource(_ anObject: NSTableViewDataSource?)

    Objective-C

    - (void)setDataSource:(id<NSTableViewDataSource>)anObject

    Parameters

    anObject

    The data source for the receiver, which must implement the appropriate methods of the NSTableViewDataSource protocol.

    Discussion

    In a managed memory environment, the receiver maintains a weak reference to the data source (that is, it does not retain the data source, see Communicating with Objects). After setting the data source, this method invokes tile.

    This method raises an NSInternalInconsistencyException if the delegate doesn’t respond to either numberOfRowsInTableView: or tableView:objectValueForTableColumn:row:.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – dataSource

  • Returns the object that provides the data displayed by the table view.

    Declaration

    Swift

    func dataSource() -> NSTableViewDataSource?

    Objective-C

    - (id<NSTableViewDataSource>)dataSource

    Return Value

    The object that provides the data displayed by the table view.

    Discussion

    See Populating View-Based Table Views Programmatically in Table View Programming Guide for Mac and the NSTableViewDataSource protocol specification for more information.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • A Boolean value indicating whether the table uses static data.

    Declaration

    Swift

    var usesStaticContents: Bool

    Objective-C

    @property BOOL usesStaticContents

    Discussion

    A static table does not rely on a data source to provide the number of rows. A static table view’s contents are set at design time and can be changed programmatically as needed. Typically, you do not change the contents of a static table view after setting them.

    In Xcode, any rows you add to a static table are saved in the corresponding nib or storyboard file and loaded with the rest of the table at runtime. You can add table rows programmatically to a static table view using the insertRowsAtIndexes:withAnimation: method. When adding rows programmatically, your table view delegate must implement the tableView:viewForTableColumn:row: method to provide the corresponding view for any new rows. You can also remove rows at any time using the removeRowsAtIndexes:withAnimation: method.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.10 and later.

  • Begins a group of updates for the table view.

    Declaration

    Swift

    func beginUpdates()

    Objective-C

    - (void)beginUpdates

    Discussion

    For NSView-based table views, multiple row changes—that is, insertions, deletions, and moves—are animated simultaneously by surrounding calls to those method calls with beginUpdates and endUpdates. These methods are nestable.

    The selected rows are maintained during the series of insertions, deletions, moves, and scrolling. If a selected row is deleted, a selection changed notification occurs after removeRowsAtIndexes:withAnimation: is called.

    It is not necessary to call beginUpdates and endUpdates if only one insertion, deletion, or move is occurring and the receiver is an NSView-based table view. When using an NSCell-based table view, you must surround any insertion, deletion, or move in an update block for animations to occur.

    The main reason for doing a batch update of changes to a table view is to avoid having the table animate unnecessarily.

    Note that these methods should be called to reflect changes in your model; they do not make any underlying model changes.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Ends the group of updates for the table view.

    Declaration

    Swift

    func endUpdates()

    Objective-C

    - (void)endUpdates

    Discussion

    Ends the group of updates for the table view. This method, like beginUpdates, is nestable. See beginUpdates for details.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Returns the column index for the specified view.

    Declaration

    Swift

    func columnForView(_ view: NSView) -> Int

    Objective-C

    - (NSInteger)columnForView:(NSView *)view

    Parameters

    view

    The view.

    Return Value

    The index of the column that contains view in the tableColumns array. Returns -1 if view is not an instance of NSTableRowView or a subview of an NSTableRowView instance. In other words, if view is not in a table view, this method returns -1. (Note that this method may also return -1 when a row is being animated away, because view no longer has a valid row.)

    Discussion

    This method is typically called in the action method of an NSButton (or NSControl) to find out what row (and column) the action should be performed on.

    The implementation is O(n) where n is the number of visible rows, so this method should generally not be called within a loop.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

    See Also

    – rowForView:

  • Moves the specified row to the new row location using animation.

    Declaration

    Swift

    func moveRowAtIndex(_ oldIndex: Int, toIndex newIndex: Int)

    Objective-C

    - (void)moveRowAtIndex:(NSInteger)oldIndex toIndex:(NSInteger)newIndex

    Parameters

    oldIndex

    Initial row index.

    newIndex

    New row index.

    Discussion

    This is similar to removing a row at oldIndex and inserting it at newIndex, except the same view is used and simply has its position updated to the new location.

    Changes happen incrementally as they are sent to the table, so as soon as this method is called the row can be considered moved. However the underlying view is not moved until endUpdates has been called.

    This method can be called multiple times within the same beginUpdates and endUpdates block.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Inserts the rows using the specified animation.

    Declaration

    Swift

    func insertRowsAtIndexes(_ indexes: NSIndexSet, withAnimation animationOptions: NSTableViewAnimationOptions)

    Objective-C

    - (void)insertRowsAtIndexes:(NSIndexSet *)indexes withAnimation:(NSTableViewAnimationOptions)animationOptions

    Parameters

    indexes

    The final positions of the new rows to be inserted.

    animationOptions

    The animation displayed during the insert. See NSTableViewAnimationOptions for the possible values that can be combined using the C bitwise OR operator.

    Discussion

    The numberOfRows in the table view is automatically increased by the count of indexes.

    Calling this method multiple times within the same beginUpdates and endUpdates block is allowed, and changes are processed incrementally.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Removes the rows using the specified animation.

    Declaration

    Swift

    func removeRowsAtIndexes(_ indexes: NSIndexSet, withAnimation animationOptions: NSTableViewAnimationOptions)

    Objective-C

    - (void)removeRowsAtIndexes:(NSIndexSet *)indexes withAnimation:(NSTableViewAnimationOptions)animationOptions

    Parameters

    indexes

    An index set containing the rows to remove.

    animationOptions

    The animation displayed during the insert. See NSTableViewAnimationOptions for the possible values that can be combined using the C bitwise OR operator.

    Discussion

    This method deletes from the table the rows represented at indexes and automatically decreases numberOfRows by the count of indexes.

    The row indexes should be with respect to the current state displayed in the table view, and not the final state, because the specified rows do not exist in the final state.

    Calling this method multiple times within the same beginUpdates and endUpdates block is allowed, and changes are processed incrementally.

    Changes are processed incrementally as the insertRowsAtIndexes:withAnimation:, removeRowsAtIndexes:withAnimation:, and the moveRowAtIndex:toIndex: methods are called. It is acceptable to delete row 0 multiple times, as long as there is still a row available.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Returns the index of the row for the specified view.

    Declaration

    Swift

    func rowForView(_ view: NSView) -> Int

    Objective-C

    - (NSInteger)rowForView:(NSView *)view

    Parameters

    view

    The view.

    Return Value

    The index of the row corresponding to the view. Returns -1 if view is not an instance of NSTableRowView or a subview of an instance of NSTableRowView. In other words, if view is not in a table view, this method returns -1. (Note that this method may also return -1 when a row is being animated away, because view no longer has a valid row.).

    Discussion

    This method is typically called in the action method for an NSButton (or NSControl) to find out what row (and column) the action should be performed on.

    The implementation is O(n) where n is the number of visible rows, so this method should generally not be called within a loop.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Registers a NIB for the identifier, so that view-based table views can use it to instantiate views.

    Declaration

    Swift

    func registerNib(_ nib: NSNib, forIdentifier identifier: String)

    Objective-C

    - (void)registerNib:(NSNib *)nib forIdentifier:(NSString *)identifier

    Parameters

    nib

    The NIB containing the view.

    identifier

    The identifier of the view to create.

    Discussion

    This method registers (or associates) nib with identifier so the table can instantiate views from it when a view with identifier is requested. This method is used when makeViewWithIdentifier:owner: is called, and there was no NIB created at design time for the specified identifier. This allows dynamic loading of NIBs that can be associated with the table.

    To remove a previously associated NIB for identifier, pass in nil for the nib value.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.8 and later.

  • The dictionary of all registered nib files for view-based table view identifiers. (read-only)

    Declaration

    Swift

    var registeredNibsByIdentifier: [NSObject : AnyObject]? { get }

    Objective-C

    @property(readonly, copy) NSDictionary *registeredNibsByIdentifier

    Discussion

    Each key in the dictionary is the identifier string used to register the nib file in the registerNib:forIdentifier: method. The value of each key is the corresponding NSNib object.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.8 and later.

  • The message sent to the table view’s target when the user double-clicks a cell or column header.

    Declaration

    Swift

    var doubleAction: Selector

    Objective-C

    @property SEL doubleAction

    Discussion

    This property stores a selector that corresponds to a method of the following form:

    • -(void)myCustomMethod:(id)sender

    When the user double-clicks a cell or column header, the table calls the specified method of its target object. The default value of this property is nil. If you do not specify a value for this property, the table view begins editing the cell.

    The clickedRow and clickedColumn properties allow you to determine which row and column the double-click occurred in or if, rather than in a row, the double-click occurred in a column heading.

    Note that if the table view uses Cocoa bindings and the Double Click Target binding is bound, both messages are invoked on their respective targets: First the Cocoa binding message is sent, then the setDoubleAction: message.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    target (NSControl)

  • The index of the column the user clicked. (read-only)

    Declaration

    Swift

    var clickedColumn: Int { get }

    Objective-C

    @property(readonly) NSInteger clickedColumn

    Discussion

    This property contains the index in the tableColumns array of the column that the user clicked. The value is -1 when the user clicks in an area of the table view that is not occupied by columns or when the user clicks a row that is a group separator.

    The value of this property is meaningful in the target object’s implementation of the action and double-action methods. You can also use the value to determine which contextual menu to display when the user Control-clicks in a table. Note that the clickedColumn value remains valid when the menu item sends the action message. To see an example of using clickedColumn in the implementation of a contextual menu, download the DragNDropOutlineView: implementing drag and drop in an NSOutlineView sample project.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    clickedRow
    setAction: (NSControl)
    doubleAction

  • The index of the row the user clicked.

    Declaration

    Swift

    var clickedRow: Int { get }

    Objective-C

    @property(readonly) NSInteger clickedRow

    Discussion

    This property contains the index of the row that the user clicked. The value is -1 when the user clicks in an area of the table view that is not occupied by table rows.

    The value of this property is meaningful in the target object’s implementation of the action and double-action methods. You can also use the value to determine which contextual menu to display when the user Control-clicks in a table. Note that you should check to see if clickedRow is one of the rows the user selected and if it is, perform the contextual menu operation on all of the selected rows. To see an example of using clickedRow in the implementation of a contextual menu, download the DragNDropOutlineView: implementing drag and drop in an NSOutlineView sample project.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • A Boolean value indicating whether the table view allows the user to rearrange columns by dragging their headers.

    Declaration

    Swift

    var allowsColumnReordering: Bool

    Objective-C

    @property BOOL allowsColumnReordering

    Discussion

    The default value of this property is YEStrue, which allows the user to rearrange the table view’s columns. You can rearrange columns programmatically regardless of this setting.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • A Boolean value indicating whether the table view allows the user to resize columns by dragging between their headers.

    Declaration

    Swift

    var allowsColumnResizing: Bool

    Objective-C

    @property BOOL allowsColumnResizing

    Discussion

    The default of this property is YEStrue, which allows the user to resize the table view’s columns. You can resize columns programmatically regardless of this setting.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    setWidth: (NSTableColumn)

  • A Boolean value indicating whether the table view allows the user to select more than one column or row at a time.

    Declaration

    Swift

    var allowsMultipleSelection: Bool

    Objective-C

    @property BOOL allowsMultipleSelection

    Discussion

    The default is NOfalse, which allows the user to select only one column or row at a time. You can select multiple columns or rows programmatically regardless of this setting.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • A Boolean value indicating whether the table view allows the user to select zero columns or rows.

    Declaration

    Swift

    var allowsEmptySelection: Bool

    Objective-C

    @property BOOL allowsEmptySelection

    Discussion

    The default is YEStrue, which allows the user to select zero columns or rows.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • A Boolean value indicating whether the table view allows the user to select columns by clicking their headers.

    Declaration

    Swift

    var allowsColumnSelection: Bool

    Objective-C

    @property BOOL allowsColumnSelection

    Discussion

    The default is NOfalse, which prevents the user from selecting columns. You can select columns programmatically regardless of this setting.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • The horizontal and vertical spacing between cells.

    Declaration

    Swift

    var intercellSpacing: NSSize

    Objective-C

    @property NSSize intercellSpacing

    Discussion

    The default spacing is (3.0, 2.0). Changing the value of this property causes the table view to redisplay itself.

    Table views normally have a 1 pixel separation between consecutively selected rows or columns. An intercell spacing of (1.0, 1.0) or greater is required if you want this separation. An intercell spacing of (0.0, 0.0) forces there to be no separation between consecutive selections.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • rowHeight rowHeight Property

    The height of each row in the table.

    Declaration

    Swift

    var rowHeight: CGFloat

    Objective-C

    @property CGFloat rowHeight

    Discussion

    The default row height is 16.0. The value in this property is used only if the table's rowSizeStyle is set to NSTableViewRowSizeStyleCustom.

    When you change the value of this property, the table view calls the tile method to redisplay the rows using the new value.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    rowSizeStyle

  • The color used to draw the background of the table.

    Declaration

    Swift

    @NSCopying var backgroundColor: NSColor

    Objective-C

    @property(copy) NSColor *backgroundColor

    Discussion

    The default background color is light gray.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • A Boolean value indicating whether the table view uses alternating row colors for its background.

    Declaration

    Swift

    var usesAlternatingRowBackgroundColors: Bool

    Objective-C

    @property BOOL usesAlternatingRowBackgroundColors

    Discussion

    When the value of this property is YEStrue, the table uses the standard alternating row colors for the background. When the value is NOfalse, the table view uses a single solid color for the background.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.3 and later.

  • The selection highlight style used by the table view to indicate row and column selection.

    Declaration

    Swift

    var selectionHighlightStyle: NSTableViewSelectionHighlightStyle

    Objective-C

    @property NSTableViewSelectionHighlightStyle selectionHighlightStyle

    Discussion

    Setting the selection highlight style to NSTableViewSelectionHighlightStyleSourceList causes the receiver to draw its background using the source list style. It also sets the draggingDestinationFeedbackStyle to NSTableViewDraggingDestinationFeedbackStyleSourceList.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • gridColor gridColor Property

    The color used to draw grid lines.

    Declaration

    Swift

    @NSCopying var gridColor: NSColor

    Objective-C

    @property(copy) NSColor *gridColor

    Discussion

    The default color is gray.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • The grid lines drawn by the table view.

    Declaration

    Swift

    var gridStyleMask: NSTableViewGridLineStyle

    Objective-C

    @property NSTableViewGridLineStyle gridStyleMask

    Discussion

    Use this property to specify whether lines should be drawn between rows and columns. When setting this property, you can specify multiple styles at once by adding the corresponding constants together. The default value of this property is NSTableViewGridNone.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.3 and later.

  • Returns the indicator image of the specified table column.

    Declaration

    Swift

    func indicatorImageInTableColumn(_ aTableColumn: NSTableColumn) -> NSImage?

    Objective-C

    - (NSImage *)indicatorImageInTableColumn:(NSTableColumn *)aTableColumn

    Parameters

    aTableColumn

    A table column in the receiver.

    Discussion

    An indicator image is an arbitrary (small) image that is rendered on the right side of the column header. An example of its use is in Mail to indicate the sorting direction of the currently sorted column in a mailbox.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Sets the indicator image of the specified column.

    Declaration

    Swift

    func setIndicatorImage(_ anImage: NSImage?, inTableColumn aTableColumn: NSTableColumn)

    Objective-C

    - (void)setIndicatorImage:(NSImage *)anImage inTableColumn:(NSTableColumn *)aTableColumn

    Parameters

    anImage

    The indicator image for the column.

    aTableColumn

    The table column.

    Discussion

    The default sorting order indicators are available as named NSImage objects. These images are accessed using [NSImage imageNamed:] passing either @"NSAscendingSortIndicator" (the "^" icon), and @"NSDescendingSortIndicator" (the "v" icon).

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Adds the specified column as the last column of the receiver.

    Declaration

    Swift

    func addTableColumn(_ aColumn: NSTableColumn)

    Objective-C

    - (void)addTableColumn:(NSTableColumn *)aColumn

    Parameters

    aColumn

    The column to add to the receiver.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Removes the specified column from the receiver.

    Declaration

    Swift

    func removeTableColumn(_ aTableColumn: NSTableColumn)

    Objective-C

    - (void)removeTableColumn:(NSTableColumn *)aTableColumn

    Parameters

    aTableColumn

    The column to remove from the receiver.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Moves the column and heading at the specified index to the new specified index.

    Declaration

    Swift

    func moveColumn(_ columnIndex: Int, toColumn newIndex: Int)

    Objective-C

    - (void)moveColumn:(NSInteger)columnIndex toColumn:(NSInteger)newIndex

    Parameters

    columnIndex

    The current index in the tableColumns array of the column to move.

    newIndex

    The new index in the tableColumns array for the moved column.

    Discussion

    This method posts NSTableViewColumnDidMoveNotification to the default notification center.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • An array containing the current table column objects. (read-only)

    Declaration

    Swift

    var tableColumns: [AnyObject] { get }

    Objective-C

    @property(readonly, copy) NSArray *tableColumns

    Discussion

    This property contains an array of NSTableColumn objects corresponding to the columns in the table. This array contains all columns, including those that are currently hidden.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the index of the first column in the receiver whose identifier is equal to the specified identifier.

    Declaration

    Swift

    func columnWithIdentifier(_ anObject: String?) -> Int

    Objective-C

    - (NSInteger)columnWithIdentifier:(NSString *)anObject

    Parameters

    anObject

    A column identifier.

    Return Value

    The index in the tableColumns array of the first column in the receiver whose identifier is equal to anObject (when compared using isEqual:) or –1 if no columns are found with the specified identifier.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the NSTableColumn object for the first column whose identifier is equal to the specified object.

    Declaration

    Swift

    func tableColumnWithIdentifier(_ anObject: String?) -> NSTableColumn?

    Objective-C

    - (NSTableColumn *)tableColumnWithIdentifier:(NSString *)anObject

    Parameters

    anObject

    A column identifier.

    Return Value

    The NSTableColumn object for the first column whose identifier is equal to anObject, as compared using isEqual:, or nil if no columns are found with the specified identifier.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Allows the enumeration of all the table rows that are known to the table view.

    Declaration

    Swift

    func enumerateAvailableRowViewsUsingBlock(_ handler: (NSTableRowView!, Int) -> Void)

    Objective-C

    - (void)enumerateAvailableRowViewsUsingBlock:(void (^)(NSTableRowView *rowView, NSInteger row))handler

    Parameters

    handler

    The Block to apply to elements in the set.

    The Block takes two arguments:

    rowView

    The view for the row.

    row

    The index of the row

    Discussion

    The enumeration includes all views in the visibleRect, however, it may also include ones that are "in flight" due to animations or other attributes of the table.

    It is preferred to use this method to efficiently make changes over all views that exist in the table.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • A Boolean value indicating whether the table view allows the user to type characters to select rows.

    Declaration

    Swift

    var allowsTypeSelect: Bool

    Objective-C

    @property BOOL allowsTypeSelect

    Discussion

    The default value of this property is YEStrue. Set it to NOfalse if you want to disable selecting rows by typing.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • The number of columns in the table. (read-only)

    Declaration

    Swift

    var numberOfColumns: Int { get }

    Objective-C

    @property(readonly) NSInteger numberOfColumns

    Discussion

    The value in this property includes table columns that are currently hidden.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    numberOfRows

  • The number of rows in the table. (read-only)

    Declaration

    Swift

    var numberOfRows: Int { get }

    Objective-C

    @property(readonly) NSInteger numberOfRows

    Discussion

    Typically you should not ask the table view how many rows it has; instead you should interrogate the table view's data source.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    numberOfColumns
    numberOfRowsInTableView: (NSTableViewDataSource protocol)

  • A Boolean value indicating whether the table view draws grouped rows as if they are floating.

    Declaration

    Swift

    var floatsGroupRows: Bool

    Objective-C

    @property BOOL floatsGroupRows

    Discussion

    Group rows are rows for which the table view delegate’s tableView:isGroupRow: method returns YES. These rows can be displayed as if they are floating in a view-based table view.

    The default value of this property is YEStrue.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Edits the cell at the specified column and row using the specified event and selection behavior.

    Declaration

    Swift

    func editColumn(_ columnIndex: Int, row rowIndex: Int, withEvent theEvent: NSEvent?, select flag: Bool)

    Objective-C

    - (void)editColumn:(NSInteger)columnIndex row:(NSInteger)rowIndex withEvent:(NSEvent *)theEvent select:(BOOL)flag

    Parameters

    columnIndex

    The index of the column in the tableColumns array.

    rowIndex

    The row index.

    theEvent

    The event.

    flag

    YEStrue if the entered contents should be selected, otherwise NOfalse.

    Discussion

    This method is invoked automatically in response to user actions; you should rarely need to invoke it directly. theEvent is usually the mouse event that triggered editing; it can be nil when starting an edit programmatically.

    This method scrolls the receiver so that the cell is visible, sets up the field editor, and sends editWithFrame:inView:editor:delegate:event: or, if flag is YEStrue, selectWithFrame:inView:editor:delegate:start:length: to the field editor’s NSCell object with the NSTableView as the text delegate.

    This method can be overridden to customize drawing for rowIndex when using NSCell-based table views.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • The index of the column being edited. (read-only)

    Declaration

    Swift

    var editedColumn: Int { get }

    Objective-C

    @property(readonly) NSInteger editedColumn

    Discussion

    This property does not apply to view-based table views. In a view-based table view, the views are responsible for their own editing behavior. For other tables, the value reflects the index of the column being edited or –1 when there is no editing session in progress or when the currently edited row is a "full width" row.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • editedRow editedRow Property

    The index of the row being edited. (read-only)

    Declaration

    Swift

    var editedRow: Int { get }

    Objective-C

    @property(readonly) NSInteger editedRow

    Discussion

    This property does not apply to view-based table views. In a view-based table view, the views are responsible for their own editing behavior. For other tables, the value reflects the index of the row being edited or –1 when there is no editing session in progress.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Invoked when a row view is added to the table.

    Declaration

    Swift

    func didAddRowView(_ rowView: NSTableRowView, forRow row: Int)

    Objective-C

    - (void)didAddRowView:(NSTableRowView *)rowView forRow:(NSInteger)row

    Parameters

    rowView

    The row view.

    row

    The row index.

    Discussion

    The subclass can implement this method to be alerted when rowView has been added to the table. At this point, the subclass can choose to add in extra views, or modify any properties of rowView. Subclasses must be sure to call super.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Invoked when a row view was removed from the table.

    Declaration

    Swift

    func didRemoveRowView(_ rowView: NSTableRowView, forRow row: Int)

    Objective-C

    - (void)didRemoveRowView:(NSTableRowView *)rowView forRow:(NSInteger)row

    Parameters

    rowView

    The row view.

    row

    The row index. The index is -1 for rows that are being deleted from the table, and no longer have a valid row; otherwise it is the valid row that is being removed due to it being moved off screen.

    Discussion

    The subclass can implement this method to be alerted when rowView has been removed from the table. The removed rowView may be reused by the table, so any additionally inserted views should be removed at this point. Subclasses must be sure to call super.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • The view object used to draw headers over columns.

    Declaration

    Swift

    var headerView: NSTableHeaderView?

    Objective-C

    @property(strong) NSTableHeaderView *headerView

    Discussion

    To configure a table without a header view or to remove the table view’s current header view, set the value of this property to nil. For more information about header views, see NSTableHeaderView Class Reference.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • The view used to draw the area to the right of the column headers and above the vertical scroller of the enclosing scroll view.

    Declaration

    Swift

    var cornerView: NSView?

    Objective-C

    @property(strong) NSView *cornerView

    Discussion

    The default corner view draws a bezeled rectangle using a blank NSTableHeaderCell object but you can replace it with a custom view that displays an image or with a control that can handle mouse events, such as a Select All button. Your custom corner view should be as wide as a vertical NSScroller object and as tall as the receiver’s header view.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    headerView

  • Returns the rectangle containing the column at the specified index.

    Declaration

    Swift

    func rectOfColumn(_ columnIndex: Int) -> NSRect

    Objective-C

    - (NSRect)rectOfColumn:(NSInteger)columnIndex

    Parameters

    columnIndex

    The index in the tableColumns array of a column in the receiver.

    Return Value

    The rectangle containing the column at columnIndex. Returns NSZeroRect if columnIndex lies outside the range of valid column indexes for the receiver.

    Discussion

    You can use this method to update a single column more efficiently than sending the table view a reloadData message.

    • [aTableView setNeedsDisplayInRect:[aTableView rectOfColumn:column]];

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the rectangle containing the row at the specified index.

    Declaration

    Swift

    func rectOfRow(_ row: Int) -> NSRect

    Objective-C

    - (NSRect)rectOfRow:(NSInteger)row

    Return Value

    The rectangle containing the row at rowIndex. Returns NSZeroRect if rowIndex lies outside the range of valid row indexes for the receiver.

    Discussion

    You can use this method to update a single row more efficiently than sending the table view a reloadData message.

    • [aTableView setNeedsDisplayInRect:[aTableView rectOfRow:row]];

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns a range of indexes for the rows that lie wholly or partially within the vertical boundaries of the specified rectangle.

    Declaration

    Swift

    func rowsInRect(_ aRect: NSRect) -> NSRange

    Objective-C

    - (NSRange)rowsInRect:(NSRect)aRect

    Parameters

    aRect

    A rectangle in the coordinate system of the receiver.

    Return Value

    A range of indexes for the receiver’s rows that lie wholly or partially within the horizontal boundaries of aRect. If the width or height of aRect is 0, returns an NSRange whose length is 0.

    Discussion

    The location of the range is the first such row’s index, and the length is the number of rows that lie in aRect.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the indexes of the receiver’s columns that intersect the specified rectangle.

    Declaration

    Swift

    func columnIndexesInRect(_ rect: NSRect) -> NSIndexSet

    Objective-C

    - (NSIndexSet *)columnIndexesInRect:(NSRect)rect

    Parameters

    rect

    The rectangle in the receiver’s coordinate system to test for column enclosure.

    Return Value

    New NSIndexSet object containing the indexes of the receiver’s columns that intersect with rect.

    Discussion

    Columns that return YEStrue for the NSTableColumn method isHidden are excluded from the results.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Returns the index of the column the specified point lies in.

    Declaration

    Swift

    func columnAtPoint(_ aPoint: NSPoint) -> Int

    Objective-C

    - (NSInteger)columnAtPoint:(NSPoint)aPoint

    Parameters

    aPoint

    A point in the coordinate system of the receiver.

    Return Value

    The index in the tableColumns array of the column aPoint lies in, or –1 if aPoint lies outside the receiver’s bounds.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – rowAtPoint:

  • Returns the index of the row the specified point lies in.

    Declaration

    Swift

    func rowAtPoint(_ aPoint: NSPoint) -> Int

    Objective-C

    - (NSInteger)rowAtPoint:(NSPoint)aPoint

    Parameters

    aPoint

    A point in the coordinate system of the receiver.

    Return Value

    The index of the row aPoint lies in, or –1 if aPoint lies outside the receiver’s bounds.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns a rectangle locating the cell that lies at the intersection of the specified column and row.

    Declaration

    Swift

    func frameOfCellAtColumn(_ columnIndex: Int, row rowIndex: Int) -> NSRect

    Objective-C

    - (NSRect)frameOfCellAtColumn:(NSInteger)columnIndex row:(NSInteger)rowIndex

    Parameters

    columnIndex

    The index in the tableColumns array of the column containing the cell whose rectangle you want.

    rowIndex

    The index of the row containing the cell whose rectangle you want.

    Return Value

    A rectangle locating the cell that lies at the intersection of columnIndex and rowIndex. Returns NSZeroRect if columnIndex or rowIndex is greater than the number of columns or rows in the receiver.

    Discussion

    You can use this method to update a single cell more efficiently than sending the table view a reloadData message using reloadDataForRowIndexes:columnIndexes:

    The result of this method is used in a drawWithFrame:inView: message to the table column's data cell. You can subclass and override this method to customize the frame of a particular cell. However, never return a frame larger than the default implementation returns.

    The default frame is computed to have a height equal to the rectOfRow: for rowIndex, minus the half intercellSpacing height on the top and half on the bottom. The width of frame is equal to the with of the table column minus half the intercellSpacing width on the left, and half on the right.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • The table view’s column autoresizing style.

    Declaration

    Swift

    var columnAutoresizingStyle: NSTableViewColumnAutoresizingStyle

    Objective-C

    @property NSTableViewColumnAutoresizingStyle columnAutoresizingStyle

    Discussion

    This property determines how columns are resized when the table view size changes. The default value of this property is NSTableViewLastColumnOnlyAutoresizingStyle.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Resizes the last column if there’s room so the receiver fits exactly within its enclosing clip view.

    Declaration

    Swift

    func sizeLastColumnToFit()

    Objective-C

    - (void)sizeLastColumnToFit

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    columnAutoresizingStyle
    minWidth (NSTableColumn)
    maxWidth (NSTableColumn)

  • Informs the receiver that the number of records in its data source has changed.

    Declaration

    Swift

    func noteNumberOfRowsChanged()

    Objective-C

    - (void)noteNumberOfRowsChanged

    Discussion

    This method allows the receiver to update the scrollers in its scroll view without actually reloading data into the receiver. It’s useful for a data source that continually receives data in the background over a period of time, in which case the table view can remain responsive to the user while the data is received.

    See the NSTableViewDataSource protocol specification for information on the messages an NSTableView object sends to its data source.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – reloadData
    numberOfRowsInTableView: (NSTableViewDataSource protocol)

  • Properly sizes the receiver and its header view and marks it as needing display.

    Declaration

    Swift

    func tile()

    Objective-C

    - (void)tile

    Discussion

    Also resets cursor rectangles for the header view and line scroll amounts for the NSScrollView object.

    Generally for performance it is not recommend to call this method. Instead, the table will call it automatically when necessary.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    setNeedsDisplay: (NSView)

  • Sizes the table view based on a uniform column autoresizing style.

    Declaration

    Swift

    func sizeToFit()

    Objective-C

    - (void)sizeToFit

    Discussion

    All columns are resized to the same size, up to a column's maximum size. This method then invokes tile.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.3 and later.

  • Informs the receiver that the rows specified in indexSet have changed height.

    Declaration

    Swift

    func noteHeightOfRowsWithIndexesChanged(_ indexSet: NSIndexSet)

    Objective-C

    - (void)noteHeightOfRowsWithIndexesChanged:(NSIndexSet *)indexSet

    Parameters

    indexSet

    Index set of rows that have changed their height.

    Discussion

    If the delegate implements tableView:heightOfRow: this method immediately re-tiles the table view using the row heights the delegate provides.

    For NSView-based tables, this method will animate. To turn off the animation, create an NSAnimationContext grouping and set the duration to 0. Then call this method and end the grouping.

    For NSCell-based tables, this method normally doesn't animate. However, it will animate if you call it inside a beginUpdates/endUpdates block.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Draws the cells for the row at rowIndex in the columns that intersect clipRect.

    Declaration

    Swift

    func drawRow(_ rowIndex: Int, clipRect clipRect: NSRect)

    Objective-C

    - (void)drawRow:(NSInteger)rowIndex clipRect:(NSRect)clipRect

    Parameters

    rowIndex

    The row index.

    clipRect

    The intersecting rectangle.

    Discussion

    NSCell-based table views can override this method to custom the drawing of the rows.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Draws the grid lines within aRect, using the grid color set with setGridColor:.

    Declaration

    Swift

    func drawGridInClipRect(_ aRect: NSRect)

    Objective-C

    - (void)drawGridInClipRect:(NSRect)aRect

    Parameters

    aRect

    The rectangle in the table view’s coordinate system.

    Discussion

    This method draws a grid regardless of whether the receiver is set to draw one automatically.

    Subclasses can override this method to draw grid lines other than the standard ones.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Highlights the region of the receiver in the specified rectangle.

    Declaration

    Swift

    func highlightSelectionInClipRect(_ clipRect: NSRect)

    Objective-C

    - (void)highlightSelectionInClipRect:(NSRect)clipRect

    Parameters

    clipRect

    The rectangle, in the table view view’s coordinate system.

    Discussion

    This method is invoked before drawRow:clipRect:.

    NSCell-based table views can override this method to change the manner in which they highlight selections.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Draws the background of the table view in the clip rect specified by the rectangle.

    Declaration

    Swift

    func drawBackgroundInClipRect(_ clipRect: NSRect)

    Objective-C

    - (void)drawBackgroundInClipRect:(NSRect)clipRect

    Parameters

    clipRect

    The rectangle, in the table view’s coordinate system.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.3 and later.

  • The name under which table information is automatically saved.

    Declaration

    Swift

    var autosaveName: String?

    Objective-C

    @property(copy) NSString *autosaveName

    Discussion

    The table information is saved separately in user defaults for each user and for each application that user uses. If no name has been set, the value of this property is nil. Even when a table view has an autosave name, it only saves the table information when the autosaveTableColumns property is YEStrue.

    If you change the value of this property to a new name, the table reads in any saved information and sets the order and width of this table view’s columns to match. Setting the name to nil removes any previously stored state from the user defaults.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • A Boolean value indicating whether the order and width of the receiver’s columns are automatically saved.

    Declaration

    Swift

    var autosaveTableColumns: Bool

    Objective-C

    @property BOOL autosaveTableColumns

    Discussion

    When this property is set to YEStrue, the table information is saved separately for each user and application under the name specified in the autosaveName property. If you change the value of this property from NOfalse to YEStrue, the table tries to read in any saved information and sets the order and width of this table view’s columns to match. If the autosaveName property is nil, this setting is ignored and the table information is not read or saved.

    When autosave is enabled, the table saves the table column width, the table column order, any applied sort descriptors, and the table column hidden state (on OS X v 10.5 and later).

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    autosaveName

  • The column highlighted in the table.

    Declaration

    Swift

    unowned(unsafe) var highlightedTableColumn: NSTableColumn?

    Objective-C

    @property(assign) NSTableColumn *highlightedTableColumn

    Discussion

    Assigning a value to this property highlights the specified column. A highlightable column header can be used in conjunction with row selection to highlight a particular column of the table. An example of this is how the Mail application indicates the currently sorted column.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Computes and returns an image to use for dragging.

    Declaration

    Swift

    func dragImageForRowsWithIndexes(_ dragRows: NSIndexSet, tableColumns tableColumns: [AnyObject], event dragEvent: NSEvent, offset dragImageOffset: NSPointPointer) -> NSImage

    Objective-C

    - (NSImage *)dragImageForRowsWithIndexes:(NSIndexSet *)dragRows tableColumns:(NSArray *)tableColumns event:(NSEvent *)dragEvent offset:(NSPointPointer)dragImageOffset

    Parameters

    dragRows

    An index set containing the row indexes that should be in the image.

    tableColumns

    An array of table columns that should be in the image.

    dragEvent

    The event that initiated the drag.

    dragImageOffset

    An in/out parameter specifying the offset of the cursor in the image, the default value is NSZeroPoint. Returning NSZeroPoint causes the cursor to be centered.

    Return Value

    An NSImage containing a custom image for the specified rows and columns participating in the drag.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Returns whether the receiver allows dragging the rows at with the drag initiated at the specified point.

    Declaration

    Swift

    func canDragRowsWithIndexes(_ rowIndexes: NSIndexSet, atPoint mouseDownPoint: NSPoint) -> Bool

    Objective-C

    - (BOOL)canDragRowsWithIndexes:(NSIndexSet *)rowIndexes atPoint:(NSPoint)mouseDownPoint

    Parameters

    rowIndexes

    The row indexes to drag.

    mouseDownPoint

    The location where the drag was initiated.

    Return Value

    Return NOfalse to disallow the drag.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Sets the default operation mask returned by draggingSourceOperationMaskForLocal: to mask.

    Declaration

    Swift

    func setDraggingSourceOperationMask(_ mask: NSDragOperation, forLocal isLocal: Bool)

    Objective-C

    - (void)setDraggingSourceOperationMask:(NSDragOperation)mask forLocal:(BOOL)isLocal

    Parameters

    mask

    The drag operation mask. See NSDragOperation for the supported values.

    isLocal

    YEStrue if the destination is the same application, otherwise NOfalse. In either case the specified mask value is archived and used.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • A Boolean value indicating whether vertical motion is treated as a drag or selection change.

    Declaration

    Swift

    var verticalMotionCanBeginDrag: Bool

    Objective-C

    @property BOOL verticalMotionCanBeginDrag

    Discussion

    The default value of this property is YEStrue, which indicates that a vertical drag motion begins a drag. In this case a vertical drag will drag-select rows. Most often, you would want to disable vertical dragging when it’s expected that horizontal dragging is the natural motion.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • The feedback style displayed when the user drags over the table view.

    Declaration

    Swift

    var draggingDestinationFeedbackStyle: NSTableViewDraggingDestinationFeedbackStyle

    Objective-C

    @property NSTableViewDraggingDestinationFeedbackStyle draggingDestinationFeedbackStyle

    Discussion

    The default value of this property is NSTableViewDraggingDestinationFeedbackStyleRegular. However, changing the selection highlight style to NSTableViewSelectionHighlightStyleSourceList automatically changes the value of this property to NSTableViewDraggingDestinationFeedbackStyleSourceList..

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.6 and later.

  • Retargets the proposed drop operation.

    Declaration

    Swift

    func setDropRow(_ row: Int, dropOperation operation: NSTableViewDropOperation)

    Objective-C

    - (void)setDropRow:(NSInteger)row dropOperation:(NSTableViewDropOperation)operation

    Parameters

    row

    The target row index.

    operation

    The drop operation. Supported values are specified by NSTableViewDropOperation.

    Discussion

    For example, to specify a drop on the second row, specify row as 1, and operation as NSTableViewDropOn. To specify a drop below the last row, specify row as [self numberOfRows] and operation as NSTableViewDropAbove.

    Passing a value of –1 for row, and NSTableViewDropOn as the operation causes the entire table view to be highlighted rather than a specific row. This is useful if the data displayed by the receiver does not allow the user to drop items at a specific row location.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • The table view’s sort descriptors.

    Declaration

    Swift

    var sortDescriptors: [AnyObject]

    Objective-C

    @property(copy) NSArray *sortDescriptors

    Discussion

    This property contains an array of NSSortDescriptor objects. A table column is considered sortable if it has a sort descriptor that specifies the sorting direction, a key to sort by, and a selector defining how to sort. Changing the value of this property may have the side effect of calling the tableView:sortDescriptorsDidChange: method on the table view’s data source.

    The contents of this property are archived and persisted along with other column information if autosave is enabled for the table.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.3 and later.

  • Computes and returns an image to use for dragging.

    Deprecation Statement

    Use dragImageForRowsWithIndexes:tableColumns:event:offset: instead.

    Declaration

    Objective-C

    - (NSImage *)dragImageForRows:(NSArray *)dragRows event:(NSEvent *)dragEvent dragImageOffset:(NSPointPointer)dragImageOffset

    Discussion

    Override this to return a custom image. dragRows represents the rows participating in the drag. dragEvent is a reference to the mouse-down event that began the drag. dragImageOffset is an in/out parameter.

    This method is called with dragImageOffset set to NSZeroPoint, but it can be modified to reposition the returned image. A dragImageOffset of NSZeroPoint will cause the image to be centered under the cursor.

    Import Statement

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.4.

  • Controls whether the receiver proportionally resizes its columns to fit when its superview’s frame changes.

    Deprecation Statement

    Use columnAutoresizingStyle instead.

    Declaration

    Objective-C

    - (void)setAutoresizesAllColumnsToFit:(BOOL)flag

    Discussion

    If flag is YEStrue, the difference in width is distributed among the receiver’s table columns; if flag is NOfalse, only the last column is resized to fit.

    To preserve compatibility this method sets the autoresizing style to NSTableViewUniformColumnAutoresizingStyle , if flag is YEStrue. Otherwise the autoresizing style is set to NSTableViewLastColumnOnlyAutoresizingStyle.

    Import Statement

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.4.

  • Returns YEStrue if the receiver proportionally resizes its columns to fit when its superview’s frame changes, NOfalse if it only resizes the last column.

    Deprecation Statement

    Use columnAutoresizingStyle instead.

    Declaration

    Objective-C

    - (BOOL)autoresizesAllColumnsToFit

    Import Statement

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.4.

  • Selects the column at the specified index, optionally extending any existing selection.

    Deprecation Statement

    Use selectColumnIndexes:byExtendingSelection: instead.

    Declaration

    Objective-C

    - (void)selectColumn:(NSInteger)column byExtendingSelection:(BOOL)extend

    Import Statement

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.3.

  • Selects a row at the specified index, optionally extending any existing selection.

    Deprecation Statement

    Use selectRowIndexes:byExtendingSelection: instead.

    Declaration

    Objective-C

    - (void)selectRow:(NSInteger)row byExtendingSelection:(BOOL)extend

    Import Statement

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.3.

  • Writes the specified rows to the specified pasteboard.

    Deprecation Statement

    This method has been deprecated. You should implement tableView:writeRowsWithIndexes:toPasteboard: instead.

    Objective-C

    - (BOOL)tableView:(NSTableView *)aTableView writeRows:(NSArray *)rows toPasteboard:(NSPasteboard *)pboard

    Discussion

    Invoked by aTableView after it has been determined that a drag should begin, but before the drag has been started. To refuse the drag, return NOfalse. To start a drag, return YEStrue and place the drag data onto pboard (data, owner, and so on). The drag image and other drag-related information will be set up and provided by the table view once this call returns with YEStrue. rows is the list of row numbers that will be participating in the drag.

    Import Statement

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.4.

  • Sets whether the receiver draws a grid.

    Deprecation Statement

    Use gridStyleMask instead.

    Declaration

    Objective-C

    - (void)setDrawsGrid:(BOOL)flag

    Parameters

    flag

    Whether or not to draw the grid.

    Import Statement

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.3.

  • drawsGrid drawsGrid (OS X v10.3)

    Returns a Boolean value that indicates whether the receiver draws a grid.

    Deprecation Statement

    Use gridStyleMask instead.

    Declaration

    Objective-C

    - (BOOL)drawsGrid

    Return Value

    Returns whether the grid is drawn.

    Import Statement

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.3.

  • This method has been deprecated.

    Deprecation Statement

    Use selectedColumnIndexes instead.

    Declaration

    Objective-C

    - (NSEnumerator *)selectedColumnEnumerator

    Import Statement

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.3.

  • This method has been deprecated.

    Deprecation Statement

    Use selectedRowIndexes instead.

    Declaration

    Objective-C

    - (NSEnumerator *)selectedRowEnumerator

    Import Statement

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.3.

  • Returns the currently focused column.

    Deprecation Statement

    Use a view-based table view and observe the window’s first responder.

    Declaration

    Swift

    func focusedColumn() -> Int

    Objective-C

    - (NSInteger)focusedColumn

    Return Value

    The index of the column, or -1 if there is no focused column

    Discussion

    The focus interaction will always be on the selectedRow of the table. If the selectedRow is a full width cell, then focusedColumn will return 1 when focused.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

    Deprecated in OS X v10.10.

  • Sets the currently focused column to the specified index.

    Deprecation Statement

    Use a view-based table view and make a particular view the first responder to focus it.

    Declaration

    Swift

    func setFocusedColumn(_ focusedColumn: Int)

    Objective-C

    - (void)setFocusedColumn:(NSInteger)focusedColumn

    Parameters

    focusedColumn

    The index of the column to focus, or -1 if there should be no focused column.

    Discussion

    This method will redisplay the previously focused column and (if required) the new focusedColumn.

    The focused column has a focus ring drawn around the selectedRow that intersects with focusedColumn.

    You should not override this method.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.6 and later.

    Deprecated in OS X v10.10.

  • Returns whether the fully prepared cell at the specified row and column can be made the focused cell.

    Deprecation Statement

    Use a view-based table view and observe the window’s first responder.

    Declaration

    Swift

    func shouldFocusCell(_ cell: NSCell, atColumn column: Int, row row: Int) -> Bool

    Objective-C

    - (BOOL)shouldFocusCell:(NSCell *)cell atColumn:(NSInteger)column row:(NSInteger)row

    Parameters

    cell

    The prepared cell to be focused upon.

    column

    The column of the cell.

    row

    The row of the cell.

    Return Value

    YEStrue if the cell can be made the focused cell, otherwise NOfalse.

    Discussion

    By default, only cells that are enabled can be focused. In addition, if the cell is an NSTextFieldCell, it can only be focused if it is selectable or editable, and the table view delegate responds YEStrue to -tableView:shouldEditTableColumn:row:.

    Subclasses can override this to further control which cells can and can’t be made focused.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.6 and later.

    Deprecated in OS X v10.10.

  • Performs a click action on the cell at the specified row and column.

    Deprecation Statement

    Use a view-based table view and use the view to handle user interactions.

    Declaration

    Swift

    func performClickOnCellAtColumn(_ column: Int, row row: Int)

    Objective-C

    - (void)performClickOnCellAtColumn:(NSInteger)column row:(NSInteger)row

    Parameters

    column

    The column of the cell.

    row

    The row of the cell.

    Discussion

    Acquires the NSTableView, copies it, invokes performClick: or performClickWithFrame:inView: (if the cell is an NSPopUpButtonCell), and then updates the data source, if required. This method does not do any checks to see if the cell is enabled.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.6 and later.

    Deprecated in OS X v10.10.

  • Returns the fully prepared cell that the receiver will use for drawing or processing of the specified row and column.

    Deprecation Statement

    Use a view-based table view and the viewAtColumn:row:makeIfNecessary: method.

    Declaration

    Swift

    func preparedCellAtColumn(_ column: Int, row row: Int) -> NSCell

    Objective-C

    - (NSCell *)preparedCellAtColumn:(NSInteger)column row:(NSInteger)row

    Parameters

    column

    The index in the tableColumns array for which to return the appropriate cell.

    row

    The row index for which to return the appropriate cell.

    Return Value

    New NSCell subclass instance to use for the specified row and column. The value for the cell is correctly set, and the delegate method tableView:willDisplayCell:forTableColumn:row: will have been called.

    Discussion

    You can override this method to do any additional cell set up that is required, or invoke it to retrieve a cell that has its contents configured for the specified column and row.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

    Deprecated in OS X v10.10.

  • Returns a range of indexes for the receiver’s columns that lie wholly or partially within the horizontal boundaries of the specified rectangle.

    Deprecation Statement

    Use columnIndexesInRect: instead.

    Declaration

    Objective-C

    - (NSRange)columnsInRect:(NSRect)aRect

    Parameters

    aRect

    A rectangle in the coordinate system of the receiver.

    Return Value

    A range of indexes for the receiver’s columns that lie wholly or partially within the horizontal boundaries of aRect. If the width or height of aRect is 0, returns an NSRange whose length is 0.

    Discussion

    The location of the range is the first such column’s index, and the length is the number of columns that lie in aRect.

    Import Statement

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.5.

    See Also

    – rowsInRect:

  • Queries the delegate to determine if the text should begin editing.

    Deprecation Statement

    Use a view-based table view with an NSTextField in NSTextField Class Reference object instead.

    Declaration

    Swift

    func textShouldBeginEditing(_ textObject: NSText) -> Bool

    Objective-C

    - (BOOL)textShouldBeginEditing:(NSText *)textObject

    Parameters

    textObject

    The text object

    Return Value

    YEStrue if editing of the text should begin, otherwise NOfalse. Returns YEStrue if the delegate does not implement control:textShouldBeginEditing:.

    Discussion

    See the NSText class specification for more information on this text delegate method.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.10.

  • Posts an NSControlTextDidBeginEditingNotification to the default notification center.

    Deprecation Statement

    Use a view-based table view with an NSTextField in NSTextField Class Reference object instead.

    Declaration

    Swift

    func textDidBeginEditing(_ aNotification: NSNotification)

    Objective-C

    - (void)textDidBeginEditing:(NSNotification *)aNotification

    Parameters

    aNotification

    The notification posted by the field editor; see the NSText class specifications for more information on this text delegate method.

    Discussion

    For more details, see the NSControl class specification.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.10.

  • Sends textDidChange: to the edited cell and posts an NSControlTextDidChangeNotification to the default notification center.

    Deprecation Statement

    Use a view-based table view with an NSTextField in NSTextField Class Reference object instead.

    Declaration

    Swift

    func textDidChange(_ aNotification: NSNotification)

    Objective-C

    - (void)textDidChange:(NSNotification *)aNotification

    Parameters

    aNotification

    The notification posted by the field editor.

    Discussion

    See the NSText class specification for more information on this text delegate method. For additional details, see the NSControl class specification.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.10.

  • Validates the text object for the cell being edited by querying the delegate.queries the delegate using control:textShouldEndEditing:, returning the delegate’s response if it responds to that method.

    Deprecation Statement

    Use a view-based table view with an NSTextField in NSTextField Class Reference object instead.

    Declaration

    Swift

    func textShouldEndEditing(_ textObject: NSText) -> Bool

    Objective-C

    - (BOOL)textShouldEndEditing:(NSText *)textObject

    Parameters

    textObject

    The NSText object for the cell.

    Return Value

    Returns the value of the delegate’s implementation of control:textShouldEndEditing:. If the delegate does not implement the method, returns YEStrue if the cell’s new value is valid, otherwise NOfalse.

    Discussion

    See the NSText class specification for more information on this text delegate method.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.10.

  • Updates the data source based on the newly edited value and selects another cell for editing if possible according to the character that ended editing (Return, Tab, Backtab).

    Deprecation Statement

    Use a view-based table view with an NSTextField in NSTextField Class Reference object instead.

    Declaration

    Swift

    func textDidEndEditing(_ aNotification: NSNotification)

    Objective-C

    - (void)textDidEndEditing:(NSNotification *)aNotification

    Parameters

    aNotification

    The notification posted by the field editor.

    Discussion

    See the NSText class specification for more information on this text delegate method.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    Deprecated in OS X v10.10.

  • The NSTableViewRowViewKey is the key that view-based table view instances use to identify the NIB containing the template row view. You can specify a custom row view (without any code) by associating this key with the appropriate NIB name in Interface Builder.

    Declaration

    Swift

    let NSTableViewRowViewKey: NSString!

    Objective-C

    NSString *const NSTableViewRowViewKey;

    Constants

    • NSTableViewRowViewKey

      NSTableViewRowViewKey

      The key associated with the identifier in the NIB containing the template row view.

      Available in OS X v10.7 and later.

    Import Statement

  • These constants specify the drag styles displayed by the table view. They’re used by the setDraggingDestinationFeedbackStyle: and draggingDestinationFeedbackStyle.

    Declaration

    Swift

    enum NSTableViewDraggingDestinationFeedbackStyle : Int { case None case Regular case SourceList case Gap }

    Objective-C

    typedef enum NSTableViewDraggingDestinationFeedbackStyle : NSInteger { NSTableViewDraggingDestinationFeedbackStyleNone = -1, NSTableViewDraggingDestinationFeedbackStyleRegular = 0, NSTableViewDraggingDestinationFeedbackStyleSourceList = 1, NSTableViewDraggingDestinationFeedbackStyleGap = 2 } NSTableViewDraggingDestinationFeedbackStyle;

    Constants

    • None

      NSTableViewDraggingDestinationFeedbackStyleNone

      Provides no feedback when the user drags over the table view. This option exists to allow subclasses to implement their dragging destination highlighting, or to make it not show anything all.

      Available in OS X v10.6 and later.

    • Regular

      NSTableViewDraggingDestinationFeedbackStyleRegular

      Draws a solid round-rect background on drop target rows, and an insertion marker between rows. This style should be used in most cases.

      Available in OS X v10.6 and later.

    • SourceList

      NSTableViewDraggingDestinationFeedbackStyleSourceList

      Draws an outline on drop target rows, and an insertion marker between rows. This style will automatically be set for source lists when the table’s setSelectionHighlightStyle: is set to NSTableViewDraggingDestinationFeedbackStyleSourceList. This is the standard look for Source Lists, but may be used in other areas as needed.

      Available in OS X v10.6 and later.

    • Gap

      NSTableViewDraggingDestinationFeedbackStyleGap

      Provides a gap insertion when dragging over the table. Note that this style is only officially supported for NSView-based table views, but may partially work in Cell Based TableViews. The decision to use the gap style (compared to another style) can be made in tableView:draggingSession:willBeginAtPoint:forRowIndexes:, or it can dynamically be changed.

      Available in OS X v10.9 and later.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.6 and later.

  • NSTableView defines these constants to specify drop operations.

    Declaration

    Swift

    enum NSTableViewDropOperation : UInt { case On case Above }

    Objective-C

    typedef enum NSTableViewDropOperation : NSUInteger { NSTableViewDropOn, NSTableViewDropAbove } NSTableViewDropOperation;

    Constants

    • On

      NSTableViewDropOn

      Specifies that the drop should occur on the specified row.

      Available in OS X v10.0 and later.

    • Above

      NSTableViewDropAbove

      Specifies that the drop should occur above the specified row.

      Available in OS X v10.0 and later.

    Discussion

    For example, given a table with n rows (numbered with row 0 at the top visually), a row of n–1 and operation of NSTableViewDropOn would specify a drop on the last row. To specify a drop below the last row, you use a row of n and NSTableViewDropAbove for the operation.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • NSTableView defines these constants to specify grid styles. These constants are used by the gridStyleMask property. The mask can be either NSTableViewGridNone or it can contain either or both of the other options combined using the C bitwise OR operator.

    Declaration

    Swift

    struct NSTableViewGridLineStyle : RawOptionSetType { init(_ rawValue: UInt) init(rawValue rawValue: UInt) static var GridNone: NSTableViewGridLineStyle { get } static var SolidVerticalGridLineMask: NSTableViewGridLineStyle { get } static var SolidHorizontalGridLineMask: NSTableViewGridLineStyle { get } static var DashedHorizontalGridLineMask: NSTableViewGridLineStyle { get } }

    Objective-C

    typedef enum NSTableViewGridLineStyle : NSUInteger { NSTableViewGridNone = 0, NSTableViewSolidVerticalGridLineMask = 1 << 0, NSTableViewSolidHorizontalGridLineMask = 1 << 1, NSTableViewDashedHorizontalGridLineMask = 1 << 3, } NSTableViewGridLineStyle;

    Constants

    • GridNone

      NSTableViewGridNone

      Specifies that no grid lines should be displayed.

      Available in OS X v10.3 and later.

    • SolidVerticalGridLineMask

      NSTableViewSolidVerticalGridLineMask

      Specifies that vertical grid lines should be displayed.

      Available in OS X v10.3 and later.

    • SolidHorizontalGridLineMask

      NSTableViewSolidHorizontalGridLineMask

      Specifies that horizontal grid lines should be displayed.

      Available in OS X v10.3 and later.

    • DashedHorizontalGridLineMask

      NSTableViewDashedHorizontalGridLineMask

      Specifies that the horizontal grid lines should be drawn dashed.

      Available in OS X v10.7 and later.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • The following constants specify the autoresizing styles. These constants are used by the columnAutoresizingStyle property.

    Declaration

    Swift

    enum NSTableViewColumnAutoresizingStyle : UInt { case NoColumnAutoresizing case UniformColumnAutoresizingStyle case SequentialColumnAutoresizingStyle case ReverseSequentialColumnAutoresizingStyle case LastColumnOnlyAutoresizingStyle case FirstColumnOnlyAutoresizingStyle }

    Objective-C

    enum { NSTableViewNoColumnAutoresizing = 0, NSTableViewUniformColumnAutoresizingStyle, NSTableViewSequentialColumnAutoresizingStyle, NSTableViewReverseSequentialColumnAutoresizingStyle, NSTableViewLastColumnOnlyAutoresizingStyle, NSTableViewFirstColumnOnlyAutoresizingStyle }; typedef NSUInteger NSTableViewColumnAutoresizingStyle;

    Constants

    • NoColumnAutoresizing

      NSTableViewNoColumnAutoresizing

      Disable table column autoresizing.

      Available in OS X v10.4 and later.

    • UniformColumnAutoresizingStyle

      NSTableViewUniformColumnAutoresizingStyle

      Autoresize all columns by distributing space equally, simultaneously.

      Available in OS X v10.4 and later.

    • SequentialColumnAutoresizingStyle

      NSTableViewSequentialColumnAutoresizingStyle

      Autoresize each table column sequentially, from the last auto-resizable column to the first auto-resizable column; proceed to the next column when the current column has reached its minimum or maximum size.

      Available in OS X v10.4 and later.

    • ReverseSequentialColumnAutoresizingStyle

      NSTableViewReverseSequentialColumnAutoresizingStyle

      Autoresize each table column sequentially, from the first auto-resizable column to the last auto-resizable column; proceed to the next column when the current column has reached its minimum or maximum size.

      Available in OS X v10.4 and later.

    • LastColumnOnlyAutoresizingStyle

      NSTableViewLastColumnOnlyAutoresizingStyle

      Autoresize only the last table column.

      When that table column can no longer be resized, stop autoresizing. Normally you should use one of the sequential autoresizing modes instead.

      Available in OS X v10.4 and later.

    • FirstColumnOnlyAutoresizingStyle

      NSTableViewFirstColumnOnlyAutoresizingStyle

      Autoresize only the first table column.

      When that table column can no longer be resized, stop autoresizing. Normally you should use one of the sequential autoresizing modes instead.

      Available in OS X v10.4 and later.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • The following constants specify the selection highlight styles. These constants are used by the selectionHighlightStyle property.

    Declaration

    Swift

    enum NSTableViewSelectionHighlightStyle : Int { case None case Regular case SourceList }

    Objective-C

    typedef enum NSTableViewSelectionHighlightStyle : NSInteger { NSTableViewSelectionHighlightStyleNone = -1, NSTableViewSelectionHighlightStyleRegular = 0, NSTableViewSelectionHighlightStyleSourceList = 1, } NSTableViewSelectionHighlightStyle;

    Constants

    • None

      NSTableViewSelectionHighlightStyleNone

      Displays no highlight style at all.

      Available in OS X v10.6 and later.

    • Regular

      NSTableViewSelectionHighlightStyleRegular

      The regular highlight style of NSTableView. On OS X v10.7 a light blue (returned by sending NSColor a alternateSelectedControlColor message) or light gray color (returned by sending NSColor a secondarySelectedControlColor message).

      Available in OS X v10.5 and later.

    • SourceList

      NSTableViewSelectionHighlightStyleSourceList

      The source list style of NSTableView. On 10.5, a light blue gradient is used to highlight selected rows.

      Available in OS X v10.5 and later.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Specifies the animation effects to apply when inserting or removing rows.

    Declaration

    Swift

    struct NSTableViewAnimationOptions : RawOptionSetType { init(_ rawValue: UInt) init(rawValue rawValue: UInt) static var EffectNone: NSTableViewAnimationOptions { get } static var EffectFade: NSTableViewAnimationOptions { get } static var EffectGap: NSTableViewAnimationOptions { get } static var SlideUp: NSTableViewAnimationOptions { get } static var SlideDown: NSTableViewAnimationOptions { get } static var SlideLeft: NSTableViewAnimationOptions { get } static var SlideRight: NSTableViewAnimationOptions { get } }

    Objective-C

    typedef enum NSTableViewAnimationOptions : NSUInteger { NSTableViewAnimationEffectNone = 0x0, NSTableViewAnimationEffectFade = 0x1, NSTableViewAnimationEffectGap = 0x2, NSTableViewAnimationSlideUp = 0x10, NSTableViewAnimationSlideDown = 0x20, NSTableViewAnimationSlideLeft = 0x30, NSTableViewAnimationSlideRight = 0x40, } NSTableViewAnimationOptions;

    Constants

    • EffectNone

      NSTableViewAnimationEffectNone

      Use no animation effects.

      Available in OS X v10.7 and later.

    • EffectFade

      NSTableViewAnimationEffectFade

      Use a fade for row or column removal. The effect can be combined with any of the slide constants.

      Available in OS X v10.7 and later.

    • EffectGap

      NSTableViewAnimationEffectGap

      Creates a gap for newly inserted rows. This is useful for drag and drop animations that animate to a newly opened gap and should be used in the delegate method tableView:acceptDrop:row:dropOperation:.

      Available in OS X v10.7 and later.

    • SlideUp

      NSTableViewAnimationSlideUp

      Animates a row insertion or removal by sliding upward.

      Available in OS X v10.7 and later.

    • SlideDown

      NSTableViewAnimationSlideDown

      Animates a row insertion or removal by sliding downward.

      Available in OS X v10.7 and later.

    • SlideLeft

      NSTableViewAnimationSlideLeft

      Animates a row insertion by sliding from the left. Animates a row removal by sliding towards the left.

      Available in OS X v10.7 and later.

    • SlideRight

      NSTableViewAnimationSlideRight

      Animates a row insertion by sliding from the right. Animates a row removal by sliding towards the right.

      Available in OS X v10.7 and later.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • The row size style constants define the size of the rows in the table view. They are used by the effectiveRowSizeStyle and rowSizeStyle properties. You can also query the row size in the NSTableCellView class’ property rowSizeStyle.

    Declaration

    Swift

    enum NSTableViewRowSizeStyle : Int { case Default case Custom case Small case Medium case Large }

    Objective-C

    typedef enum NSTableViewRowSizeStyle : NSInteger { NSTableViewRowSizeStyleDefault = -1, NSTableViewRowSizeStyleCustom = 0, NSTableViewRowSizeStyleSmall = 1, NSTableViewRowSizeStyleMedium = 2, NSTableViewRowSizeStyleLarge = 3, } NSTableViewRowSizeStyle;

    Constants

    • Default

      NSTableViewRowSizeStyleDefault

      The table will use the system default layout size: small, medium or large.

      Available in OS X v10.7 and later.

    • Custom

      NSTableViewRowSizeStyleCustom

      The table will use the rowHeight or invoke the delegate method tableView:heightOfRow:, if implemented. The cell layout is not changed.

      Available in OS X v10.7 and later.

    • Small

      NSTableViewRowSizeStyleSmall

      The table will use a row height specified for a small table. It is required that the size be fully tested and supported if NSTableViewRowSizeStyleCustom is not used.

      Available in OS X v10.7 and later.

    • Medium

      NSTableViewRowSizeStyleMedium

      The table will use a row height specified for a medium table. It is required that the size be fully tested and supported if NSTableViewRowSizeStyleCustom is not used.

      Available in OS X v10.7 and later.

    • Large

      NSTableViewRowSizeStyleLarge

      The table will use a row height specified for a large table. It is required that the size be fully tested and supported if NSTableViewRowSizeStyleCustom is not used.

      Available in OS X v10.7 and later.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.7 and later.

  • Posted whenever a column is moved by user action in an NSTableView object. The notification object is the table view in which a column moved. The userInfo dictionary contains the following information:

    Key

    Value

    @"NSOldColumn"

    An NSNumber object containing the integer value of the column’s original index.

    @"NSNewColumn"

    An NSNumber object containing the integer value of the column’s present index.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Posted whenever a column is resized in an NSTableView object. The notification object is the table view in which a column was resized. The userInfo dictionary contains the following information:

    Key

    Value

    @"NSTableColumn"

    The column that was resized.

    @"NSOldWidth"

    An NSNumber containing the integer value of the column’s original width.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Posted after an NSTableView object's selection changes. The notification object is the table view whose selection changed. This notification does not contain a userInfo dictionary.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Posted as an NSTableView object's selection changes (while the mouse button is still down). Note that the notification is sent only for mouse events that change the table’s selection, not keyboard events. The notification object is the table view whose selection is changing. This notification does not contain a userInfo dictionary.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.0 and later.