On Apr 19, 2014, at 7:09 PM, Mark <[email protected]> wrote:

> I can't use [CBLManager sharedInstance] because I'm calling [CBLManager 
> initWithDirectory:options:error: ] to specify a directory.
> I call this from two different objects, both on the main thread but doing 
> separate work.

If they're both on the main thread, they can share the same CBLManager. For 
instance you can store it in a global or in a property of your UI/NSApplication 
delegate.

> One of them, however, passes a CBLModel acquired from the CBLDatabase to an 
> NSOperation subclass to do some work on a background NSOperationQueue. I'm 
> guessing this is going to cause me some problems.

Yeah, this gets a little harder. What I would do is create a CBLManager for use 
by these background operations and create a [serial] dispatch queue for it. 
Then you can call its objects from your operations by wrapping the calls in a 
dispatch_sync (or dispatch_async) block.

--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/9E00767F-A665-471C-B9D7-BB78D68EE776%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to