NSTableViewDataSource
A set of methods that a table view uses to provide data to a table view and to allow the editing of the table view’s data source object.
Declaration
protocol NSTableViewDataSource : NSObjectProtocolOverview
Some of the methods in this protocol, such as tableView(_:objectValueFor:row:) and numberOfRows(in:) along with other methods that return data, are called frequently, so they must be efficient.
If you’re not using Cocoa bindings to provide data to the table view, the following methods are required:
tableView(_:setObjectValue:for:row:) (cell-based tables only)
For more information, see Cocoa Bindings.
Topics
Getting Values
Setting Values
Implementing Pasteboard Support
Drag and Drop
Supporting Table View Drag and Drop Through File PromisestableView(_:acceptDrop:row:dropOperation:)tableView(_:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWith:)tableView(_:validateDrop:proposedRow:proposedDropOperation:)tableView(_:writeRowsWith:to:)tableView(_:draggingSession:willBeginAt:forRowIndexes:)tableView(_:updateDraggingItemsForDrag:)tableView(_:draggingSession:endedAt:operation:)