Hi, 
I think in this kind of cases is better to define your own datasource. You 
can check the source is on git. Then, just create your own based on the one 
there by modifying what you need. You can also subclass it but some stuff 
won't be as easy to modify by subclassing.

Cheers

On Wednesday, April 8, 2015 at 5:23:01 AM UTC-3, Souhail Marghabi wrote:
>
> 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/a3a0570f-3f71-42ed-9d74-53f3f156356c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to