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.
SDK
- macOS 10.6+
Framework
- App
Kit
Declaration
protocol NSTableViewDataSource
Overview
Some of the methods in this protocol, such as table
and number
along with other methods that return data, are called frequently, so they must be efficient.
Note
View-based table views must not use the table
method for setting values. Instead the views must explicitly set the values for the fields, or use Cocoa bindings. Likewise, use target/action for editing. See Table View Programming Guide for Mac for more information on populating view-based and cell-based table views.
If you’re not using Cocoa bindings to provide data to the table view, the following methods are required:
table
(cell-based tables only)View(_: set Object Value: for: row:)
To learn more about Cocoa bindings, see Cocoa Bindings Programming Topics.