Hi,
Before integrating couches lite iOS, we used this good practice :
http://martiancraft.com/blog/2015/03/core-data-stack/
We have two separate contexts, a main context used in every controllers,
and a private context, parent of the previous, used to persist save on disk.
Here's an example :
self.parentContext = [[NSManagedObjectContext alloc]
initWithConcurrencyType:NSPrivateQueueConcurrencyType];
[self.parentContext setPersistentStoreCoordinator: coordinator];
self.context = [[NSManagedObjectContext alloc] initWithConcurrencyType:
NSMainQueueConcurrencyType];
self.context.parentContext = self.parentContext;
[incrementalStore addObservingManagedObjectContext:self.context];
[incrementalStore addObservingManagedObjectContext:self.parentContext];
But that doesn't work : THREAD-SAFETY VIOLATION: This database is being
used on a thread it wasn't "
" created on! Please see the concurrency guidelines in the
Couchbase Lite "
"documentation.
So my question is : what's the best practice to perform a save that doesn't
slow the UI ?
Thanks
--
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/0a000b96-5000-4ccb-b4fc-c9740d60cb68%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.