On Nov 16, 2015, at 10:57 AM, Brendan Duddridge 
<[email protected]<mailto:[email protected]>> wrote:

I also have bindings to my model objects that display things such as the name 
of a form or the name of a field. So when KVO updates those from a background 
thread, that's where the crashes happen as it's trying to update the UI because 
of the notifications.

This is one of those problems where the solution is “then don’t do that!” Those 
model objects are associated with a background thread. Your UI controls are 
associated with the main thread. So you can’t use a synchronous mechanism like 
bindings to connect them, because you’ll end up messaging objects on the wrong 
thread.

The way to do this is to have two CBLManagers, one on the main thread and one 
on your background dispatch queue. You use the one on the main thread and its 
CBL objects to drive your UI. You use the ones on the background thread/queue 
to do background operations.

—Jens

-- 
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/B58A4E78-C9DB-470F-9E80-1C5BB68C42C4%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to