Hi, Thanks for your suggestion. I was thinking maybe I won’t use the couchbase table source and use my own. and have the output of the query stored in an nsarray that i would process in the tableview delegates and assign the data to each section in my tableview.
> Le 8 avr. 2015 à 14:31, Martin Palatnik <[email protected]> a écrit : > > 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 a topic in the Google > Groups "Couchbase Mobile" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/mobile-couchbase/L1p5QAhSkRI/unsubscribe > <https://groups.google.com/d/topic/mobile-couchbase/L1p5QAhSkRI/unsubscribe>. > To unsubscribe from this group and all its topics, send an email to > [email protected] > <mailto:[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 > > <https://groups.google.com/d/msgid/mobile-couchbase/a3a0570f-3f71-42ed-9d74-53f3f156356c%40googlegroups.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- 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/910BB738-A62A-44B6-8F07-6EE6447B1903%40gmail.com. For more options, visit https://groups.google.com/d/optout.
