Couchbase Lite
Objective-C API for iOS and Mac OS
 All Classes Functions Variables Properties
CBLUITableSource Class Reference

A UITableView data source driven by a CBLLiveQuery. More...

#import <CBLUITableSource.h>

Inheritance diagram for CBLUITableSource:

Instance Methods

(void) - reloadFromQuery
 Rebuilds the table from the query's current .rows property. More...
 
(CBLQueryRow *) - rowAtIndex:
 Convenience accessor to get the row object for a given table row index. More...
 
(NSIndexPath *) - indexPathForDocument:
 Convenience accessor to find the index path of the row with a given document. More...
 
(CBLQueryRow *) - rowAtIndexPath:
 Convenience accessor to return the query row at a given index path. More...
 
(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...
 
CBLLiveQueryquery
 The query whose rows will be displayed in the table. More...
 
NSArray * rows
 The current array of CBLQueryRows being used as the data source for the table. 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 YES.)
 

Detailed Description

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.

Method Documentation

- (void) reloadFromQuery

Rebuilds the table from the query's current .rows property.

- (CBLQueryRow*) rowAtIndex: (NSUInteger)  index

Convenience accessor to get the row object for a given table row index.

- (NSIndexPath*) indexPathForDocument: (CBLDocument *)  document

Convenience accessor to find the index path of the row with a given document.

- (CBLQueryRow*) rowAtIndexPath: (NSIndexPath *)  path

Convenience accessor to return the query row at a given index path.

- (CBLDocument*) documentAtIndexPath: (NSIndexPath *)  path

Convenience accessor to return the document at a given index path.

- (BOOL) deleteDocumentsAtIndexes: (NSArray *)  indexPaths
error: (NSError **)  outError 

Deletes the documents at the given row indexes, animating the removal from the table.

- (BOOL) deleteDocuments: (NSArray *)  documents
error: (NSError **)  outError 

Asynchronously deletes the given documents, animating the removal from the table.

Property Documentation

- (IBOutlet UITableView*) tableView
readwritenonatomicretain

The table view to manage.

- (CBLLiveQuery*) query
readwriteatomicretain

The query whose rows will be displayed in the table.

- (NSArray*) rows
readnonatomicassign

The current array of CBLQueryRows being used as the data source for the table.

- (NSString*) labelProperty
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.


The documentation for this class was generated from the following file: