ASTableDataSource Protocol Reference
Conforms to | ASCommonTableDataSource NSObject |
---|---|
Declared in | ASTableNode.h |
– numberOfSectionsInTableNode:
Asks the data source for the number of sections in the table node.
- (NSInteger)numberOfSectionsInTableNode:(ASTableNode *)tableNode
Declared In
ASTableNode.h
– tableNode:numberOfRowsInSection:
Asks the data source for the number of rows in the given section of the table node.
- (NSInteger)tableNode:(ASTableNode *)tableNode numberOfRowsInSection:(NSInteger)section
Declared In
ASTableNode.h
– tableNode:nodeBlockForRowAtIndexPath:
Asks the data source for a block to create a node to represent the row at the given index path. The block will be run by the table node concurrently in the background before the row is inserted into the table view.
- (ASCellNodeBlock)tableNode:(ASTableNode *)tableNode nodeBlockForRowAtIndexPath:(NSIndexPath *)indexPath
Parameters
tableNode |
The sender. |
---|---|
indexPath |
The index path of the row. |
Return Value
a block that creates the node for display at this indexpath. Must be thread-safe (can be called on the main thread or a background queue) and should not implement reuse (it will be called once per row).
Discussion
Note: This method takes precedence over tableNode:nodeForRowAtIndexPath: if implemented.
Declared In
ASTableNode.h
– tableNode:nodeForRowAtIndexPath:
Asks the data source for a node to represent the row at the given index path.
- (ASCellNode *)tableNode:(ASTableNode *)tableNode nodeForRowAtIndexPath:(NSIndexPath *)indexPath
Parameters
tableNode |
The sender. |
---|---|
indexPath |
The index path of the row. |
Return Value
a node to display for this row. This will be called on the main thread and should not implement reuse (it will be called once per row). Unlike UITableView’s version, this method is not called when the row is about to display.
Declared In
ASTableNode.h
– tableView:nodeForRowAtIndexPath:
Similar to -tableView:cellForRowAtIndexPath:.
- (ASCellNode *)tableView:(ASTableView *)tableView nodeForRowAtIndexPath:(NSIndexPath *)indexPath
Parameters
indexPath |
The index path of the requested node. |
---|---|
tableNode |
The sender. |
Return Value
a node for display at this indexpath. This will be called on the main thread and should not implement reuse (it will be called once per row). Unlike UITableView’s version, this method is not called when the row is about to display.
Declared In
ASTableNode.h
– tableView:nodeBlockForRowAtIndexPath:
Similar to -tableView:nodeForRowAtIndexPath: This method takes precedence over tableView:nodeForRowAtIndexPath: if implemented.
- (ASCellNodeBlock)tableView:(ASTableView *)tableView nodeBlockForRowAtIndexPath:(NSIndexPath *)indexPath
Parameters
tableView |
The sender. |
---|---|
indexPath |
The index path of the requested node. |
Return Value
a block that creates the node for display at this indexpath. Must be thread-safe (can be called on the main thread or a background queue) and should not implement reuse (it will be called once per row).
Declared In
ASTableNode.h
– tableViewLockDataSource:
Indicator to lock the data source for data fetching in async mode. We should not update the data source until the data source has been unlocked. Otherwise, it will incur data inconsistency or exception due to the data access in async mode. (Deprecated: The data source is always accessed on the main thread, and this method will not be called.)
- (void)tableViewLockDataSource:(ASTableView *)tableView
Parameters
tableView |
The sender. |
---|
Declared In
ASTableNode.h
– tableViewUnlockDataSource:
Indicator to unlock the data source for data fetching in asyn mode. We should not update the data source until the data source has been unlocked. Otherwise, it will incur data inconsistency or exception due to the data access in async mode. (Deprecated: The data source is always accessed on the main thread, and this method will not be called.)
- (void)tableViewUnlockDataSource:(ASTableView *)tableView
Parameters
tableView |
The sender. |
---|
Declared In
ASTableNode.h