Hello Everyone,
I have two queries that should fill two sections in my uitableview. In the
iOS couchbase examples, they add an object of time CBLUITableSource to
which they assign one query.
For my case, how should I define my dataSource for the tableview driven by
two couchebase queries? I have always defined the process by doing this in
my view didload :
CBLQuery *query = [DRContacts queryContactsBy:self.currentOfferID error
:&error];
if (_dataSource) {
_dataSource.query = query.asLiveQuery;
_dataSource.tableView = self.tableView;
// _dataSource.tableView = self.contactsTableView;
}
CBLQueryEnumerator *rows = [query run:&error];
and in the couchebase table delegate:
- (UITableViewCell *)couchTableSource:(CBLUITableSource *)source
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
DRContactsTableViewCell *cell = (DRContactsTableViewCell *)[source.
tableView
dequeueReusableCellWithIdentifier:CellIdentifier
forIndexPath:indexPath];
CBLQueryRow *row = [source rowAtIndex:indexPath.row];
//how to tell it that i have two queries from where i need to get the
rows...
DRContacts *contactCell = [DRContacts modelForDocument:row.document];
return cell;
}
Thank you for your assistance in advance.
--
You received this message because you are subscribed to the Google Groups
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mobile-couchbase/48f19928-a4fb-4b21-8d42-a77663368583%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.