from the official RestKit page Restkit Github I found the following to reset the store:
- (void) resetSavedDatabase:(id)sender {
RKManagedObjectStore *objectStore = [[RKObjectManager sharedManager] objectStore];
[objectStore resetPersistentStores];
[objectStore save:nil];
}
That works. But if I then do the following after this method I got a error:
TestEntity *testEntity = [TestEntity createEntity];
testEntity.name = @"TestEntity";
NSError *error;
[[RKObjectManager sharedManager].objectStore save:&error];
Error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Object's persistent store is not reachable from this NSManagedObjectContext's coordinator'
Everything is called in the background. The idea is, that I want to preload some sqlite data and then synchronize them with my synchronize logic. (The logic is working when I do not delete the persistent store)
Can someone help me?
deletePersistentStore
has changed to resetPersistentStores.. please update your question accordingly – abbood