I need to split my Core Data persistent storage (managed by RestKit) into two parts. One part should persist only in memory and not be saved to disk, and the other part should be saved. Usually it is done by adding configurations to Core Data object model and creating two stores for each configuration. But RestKit's RKManagedObjectStore method - (NSPersistentStore )addInMemoryPersistentStore:(NSError *)error; doesn't take configuration name and adds persistent store with configuration nil:
- (NSPersistentStore *)addInMemoryPersistentStore:(NSError **)error
{
if (! self.persistentStoreCoordinator) [self createPersistentStoreCoordinator];
return [self.persistentStoreCoordinator addPersistentStoreWithType:NSInMemoryStoreType configuration:nil URL:nil options:nil error:error];
}
According to Core Data documentation, this prevents from using any configurations in persistent store coordinator. I can reload this method and make it use configuration, but first I want to ask: Are there any reasons for me to not to do this? There must be reasons why addInMemoryPersistentStore looks like it looks. May be someone had tried to make the same thing as I'm going to do and found that it doesn't work?