I am changing my CoreData setup to have 2 NSManagedObjectContext
s under 1 NSPersistentStoreCoordinator
.
- The Root Context is
NSManagedObjectContext
instantiated withNSPrivateQueueConcurrencyType
and set toNSMergeByPropertyStoreTrumpMergePolicy
- The Main Context is
NSManagedObjectContext
instantiated withNSMainQueueConcurrencyType
also set to aNSMergeByPropertyStoreTrumpMergePolicy
Both of them are not connected by "parent-and-child" relationship, however they are assigned the same NSPersistentStoreCoordinator
object. The Main Context is listening to the Root Context's NSManagedObjectContextDidSaveNotification
notification and do the necessary merging inside performBlock:
Occasionally, when an instance of NSFetchedResultsController
is hooked with the Main Context does a performFetch
I got
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'statement is still active'
I am wondering if what I'm about to do here should not be done or a limitation of Core Data.
Thanks