On Jul 17, 2014, at 3:39 AM, Ragu Vijaykumar <[email protected]> wrote:

>     self.labTagIdQuery = [[self.reference queryLabTagId] asLiveQuery];
>     self.labTagIdQuery.limit = 30;
>     [self.labTagIdQuery addObserver:self forKeyPath:@"rows" options:0 
> context:NULL];
> 
> - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
>     return [self.labTagIdQuery.rows count];
> }

There might be a race condition in your code that's been triggered by some 
change in timing with the new code. CBLLiveQuery runs asynchronously, so its 
.rows property will initially be nil until the query has time to complete on 
the background thread. If your KV-observer method reloads the table view, 
you're fine, but if not the view will get populated with whatever was in the 
query results at the time UIKit first loaded the table, which could be nil.

If that's not the case -- i.e. if labTagIdQuery either never notifies you or 
its rows remains empty after the notification -- let me know. I just wrote a 
quick test case verifying that live queries still work correctly with views 
that emit nil values (as yours does.)

--Jens

PS: I did find a regression involving live queries on views that emit 'doc' as 
the value, and pushed a fix a few minutes ago.

-- 
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/4A553C15-EF43-40FF-89B8-1DD6B22C6C61%40mooseyard.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to