![]() |
Couchbase Lite
Objective-C API for iOS and Mac OS
|
A UITableView data source driven by a CBLLiveQuery.
It populates the table rows from the query rows, and automatically updates the table as the query results change when the database is updated. A CBLUITableSource can be created in a nib. If so, its tableView outlet should be wired up to the UITableView it manages, and the table view's dataSource outlet should be wired to it.
Instance Methods | |
| (void) | - reloadFromQuery |
| Rebuilds the table from the query's current .rows property. More... | |
| () | - CBLArrayOf |
| The current array of CBLQueryRows being used as the data source for the table. More... | |
| (nullable CBLQueryRow *) | - rowAtIndex: |
| Convenience accessor to get the row object for a given table row index. More... | |
| (nullable NSIndexPath *) | - indexPathForDocument: |
| Convenience accessor to find the index path of the row with a given document. More... | |
| (nullable CBLQueryRow *) | - rowAtIndexPath: |
| Convenience accessor to return the query row at a given index path. More... | |
| (nullable CBLDocument *) | - documentAtIndexPath: |
| Convenience accessor to return the document at a given index path. More... | |
| (BOOL) | - deleteDocumentsAtIndexes:error: |
| Deletes the documents at the given row indexes, animating the removal from the table. More... | |
| (BOOL) | - deleteDocuments:error: |
| Asynchronously deletes the given documents, animating the removal from the table. More... | |
Properties | |
| IBOutlet UITableView * | tableView |
| The table view to manage. More... | |
| CBLLiveQuery * | query |
| The query whose rows will be displayed in the table. More... | |
| UITableViewRowAnimation | rowInsertAnimation |
| Animation used when inserting new rows; default is UITableViewRowAnimationAutomatic. More... | |
| UITableViewRowAnimation | rowDeleteAnimation |
| Animation used when deleting rows; default is UITableViewRowAnimationAutomatic. More... | |
| UITableViewRowAnimation | rowReplaceAnimation |
| Animation used when replacing rows; default is UITableViewRowAnimationAutomatic. More... | |
| NSString * | labelProperty |
| If non-nil, specifies the property name of the query row's value that will be used for the table row's visible label. More... | |
| BOOL | deletionAllowed |
| Is the user allowed to delete rows by UI gestures? (Defaults to NO.) More... | |
| - (void) reloadFromQuery |
Rebuilds the table from the query's current .rows property.
| - CBLArrayOf | (CBLQueryRow *) |
The current array of CBLQueryRows being used as the data source for the table.
| - (nullable CBLQueryRow*) rowAtIndex: | (NSUInteger) | index |
Convenience accessor to get the row object for a given table row index.
| - (nullable NSIndexPath*) indexPathForDocument: | (CBLDocument *) | document |
Convenience accessor to find the index path of the row with a given document.
| - (nullable CBLQueryRow*) rowAtIndexPath: | (NSIndexPath *) | path |
Convenience accessor to return the query row at a given index path.
| - (nullable CBLDocument*) documentAtIndexPath: | (NSIndexPath *) | path |
Convenience accessor to return the document at a given index path.
| - (BOOL) deleteDocumentsAtIndexes: | (CBLArrayOf(NSIndexPath *) *) | indexPaths | |
| error: | (NSError **) | outError | |
Deletes the documents at the given row indexes, animating the removal from the table.
| - (BOOL) deleteDocuments: | (CBLArrayOf(CBLDocument *) *) | documents | |
| error: | (NSError **) | outError | |
Asynchronously deletes the given documents, animating the removal from the table.
|
readwritenonatomicretain |
The table view to manage.
|
readwriteatomicretain |
The query whose rows will be displayed in the table.
|
readwritenonatomicassign |
Animation used when inserting new rows; default is UITableViewRowAnimationAutomatic.
|
readwritenonatomicassign |
Animation used when deleting rows; default is UITableViewRowAnimationAutomatic.
|
readwritenonatomicassign |
Animation used when replacing rows; default is UITableViewRowAnimationAutomatic.
|
readwriteatomiccopy |
If non-nil, specifies the property name of the query row's value that will be used for the table row's visible label.
If the row's value is not a dictionary, or if the property doesn't exist, the property will next be looked up in the document's properties. If this doesn't meet your needs for labeling rows, you should implement -couchTableSource:willUseCell:forRow: in the table's delegate.
|
readwritenonatomicassign |
Is the user allowed to delete rows by UI gestures? (Defaults to NO.)