I'm using two RKObjectManagers, one without an RKManagedObjectStore, (which is the shared instance) and one with. When I attempt to set the RKManagedObjectStore like so:
[self.storeBackedObjectManager setObjectStore:[RKManagedObjectStore objectStoreWithStoreFilename:@"conversations.sqlite"]];
I get the following error:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '[RKObjectManager sharedManager].objectStore cannot be nil'
It seems that RestKit is trying to access the objectstore of the sharedManager (which doesn't use an object store), in NSManagedObject+ActiveRecord.m
:
+ (NSManagedObjectContext*)managedObjectContext {
NSAssert([RKObjectManager sharedManager], @"[RKObjectManager sharedManager] cannot be nil");
NSAssert([RKObjectManager sharedManager].objectStore, @"[RKObjectManager sharedManager].objectStore cannot be nil");
return [[[RKObjectManager sharedManager] objectStore] managedObjectContext];
}
Is there any way to pass a reference to my second, store backed RKObjectManager instance? (This mapping works fine if I temporarily set the shared manager to the store backed instance)