Couchbase Lite
Objective-C API for iOS and Mac OS
CBLQueryEnumerator Class Reference

Detailed Description

Enumerator on a CBLQuery's result rows.

The objects returned are instances of CBLQueryRow.

Inheritance diagram for CBLQueryEnumerator:

Instance Methods

(nullable CBLQueryRow *) - nextObject
 
(nullable CBLQueryRow *) - nextRow
 The next result row. More...
 
(CBLQueryRow *) - rowAtIndex:
 Random access to a row in the result. More...
 
(void) - sortUsingDescriptors:
 Re-sorts the rows based on the given sort descriptors. More...
 
(instancetype) - NS_UNAVAILABLE
 
(void) - reset
 

Properties

NSUInteger count
 The number of rows returned in this enumerator. More...
 
UInt64 sequenceNumber
 The database's current sequenceNumber at the time the view was generated. More...
 
BOOL stale
 YES if the database has changed since the view was generated. More...
 

Method Documentation

◆ nextObject()

- (nullable CBLQueryRow*) nextObject

◆ nextRow()

- (nullable CBLQueryRow*) nextRow

The next result row.

This is the same as -nextObject but with a checked return type.

◆ rowAtIndex:()

- (CBLQueryRow*) rowAtIndex: (NSUInteger)  index

Random access to a row in the result.

◆ sortUsingDescriptors:()

- (void) sortUsingDescriptors: (NSArray *)  sortDescriptors

Re-sorts the rows based on the given sort descriptors.

This operation requires that all rows be loaded into memory, so you can't have previously called -nextObject, -nextRow or for...in on this enumerator. (But it's fine to use them after calling this method.) You can call this method multiple times with different sort descriptors, but the effects on any in-progress enumeration are undefined. The items in the array can be NSSortDescriptors or simply NSStrings. An NSString will be treated as an NSSortDescriptor with the string as the keyPath; prefix with a "-" for descending sort. Key-paths are interpreted relative to a CBLQueryRow, so they should start with "value" to refer to the value, or "key" to refer to the key. A limited form of array indexing is supported, so you can refer to "key[1]" or "value[0]" if the key or value are arrays. This only works with indexes from 0 to 3.

◆ NS_UNAVAILABLE()

- (instancetype) NS_UNAVAILABLE

◆ reset()

- (void) reset

Property Documentation

◆ count

- (NSUInteger) count
readatomicassign

The number of rows returned in this enumerator.

◆ sequenceNumber

- (UInt64) sequenceNumber
readatomicassign

The database's current sequenceNumber at the time the view was generated.

◆ stale

- (BOOL) stale
readatomicassign

YES if the database has changed since the view was generated.


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