DAArrayDataSource Class

This is a Library topic for Data Abstract for Xcode
This page is generated from external data, please do not update
Protocols — Classes — Enums — Implements
Contents |
Overview
DAArrayDataSource is an unsupported helper class that makes it easy to render data from a NSArray of KVO-compliant objects (such as rows from a DADataTable in a NSTableView component. It provides the following functionality:
- NSTableViewDataSource methods for filling the view
- Support for inline editing (toggle-able via the readonly property)
- Two-way sorting of data in the table view by clicking the header
- Grid coloring per row, via delegate callbacks
- Automatic highlighting of changed rows with bold font, when showing DADataTableRows
- Automatic adjustment of row-height for the value of a chosen field
- Persistence of selection when reloading and sorting data
While most advanced data entry applications will require custom data sources or Cocoa Binding, DAArrayDataSource provides a convenient and easy way to "just get some data up" in a grid – whether that data comes from a DADataTable or another KVC compliant source.
Location
DataAbstract/DAArrayDataSource.h
- Ancestry: NSObject | DAArrayDataSource
Properties
| array retain |
|---|
|
Represents the array of the DADataTableRow to show in NSTableView. (Re)assigning this property will automatically update the view, as needed.
|
| delegate assign |
|
Delegates implementing the DAArrayDataSourceDelegate protocol, to be called for advanced features, such as row coloring or handling double clicks.
|
| fontSize assign |
|
Specifies the font size for text in the NSTableView rows.
|
| mainTextField copy |
|
Identifies a field (or KVC name) that will be considered the main "text" of the table. When set, each row will automatically be sized to the appropriate height so that this text is fully visible. This property is useful for tables with one text field and additional auxiliary fields.
|
| maxMainTextFieldHeight assign nonatomic |
|
Specifies MAX height for each row in the NSTableView.
|
| readonly assign |
|
Defines whether the NSTableView will allow inline editing (YES) by double-clicking on fields, or not (NO). If set to YES, the array elements must be KVC-compliant for updating.
|
| rowHeight assign |
|
Specifies the height of rows in NSTableView.
|
| secondarySortField nonatomic retain |
|
Contains the name of the second field is used to sort the data. For example if your sortField is "City" and secondarySortField is "LastName" then data in the data source will be sorted by City then by LastName
|
| selectedRow |
|
Represent the instance of the first selected row. If nothing selected then it returns nil.
|
| selectedRowCount |
|
Returns the count of selected rows.
|
| selectedRows |
|
Represent array of selected rows. If no one row selected then it returns an empty array
|
| sortAscending assign nonatomic |
|
Boolean flag that defines order of sorting data. YES means accending and NO means descending sort order.
|
| sortField nonatomic retain |
|
Contains the name of the table field which should be used to sort the data.
|
| sortLocalizedCaseInsensitive assign nonatomic |
|
Boolean flag that managing applying localized and case insensetive comparison for sorting the data.
|
| tableView assign |
|
Reference to NSTableView outlet which is used for representing data
|
Instance Methods
| selectRow: |
|---|
|
Method takes row instance and select it in the managed table view. If table view does not contain given row then method does nothing.
|
See Also
- Using DAArrayDataSource (Article)
- Lists
- Data Abstract for Xcode: Protocols — Classes — Enums — Implements
- RemObjects SDK for Xcode: Protocols — Classes — Enums — Aliases — Implements
- Data Abstract shared: Data Types – File Types
- other editions:
- Data Abstract for .NET: Namespaces — Interfaces — Classes — Enums — Implements
- Data Abstract for Delphi: Interfaces — Classes — Enums — Aliases — Implements
- Data Abstract for Java: Namespaces — Interfaces — Classes — Enums — Implements
- Data Abstract for JavaScript: Objects
- Data Abstract for Xcode: Protocols — Classes — Enums — Implements

Product: RemObjects Data Abstract
Available Editions: Data Abstract for .NET, Delphi and Xcode