couchbase/couchbase-lite-ios — pull request #370 by eliog (2014-06-24 14:08:38+00:00)
Title: Post DatabaseChange notifications on main queue

I noticed that database change notifications weren't being received by CBLQuery when the change came remotely (via replication). This only started happening when I started using a dispatchQueue.

I noticed that the DatabaseChangeNotification wasn't happening in the main thread, so I wrapped it in a dispatch_sync(dispatch_get_main_queue(), ^{ }

This fixed the issue for me.