Recreate the retained MOC reference on store deletion

This commit is contained in:
Blake Watters
2012-02-23 20:49:59 -05:00
parent 07a18a75b0
commit 6c4461956f

View File

@@ -353,6 +353,9 @@ static RKManagedObjectStore *defaultObjectStore = nil;
- (void)deletePersistantStore {
[self deletePersistantStoreUsingSeedDatabaseName:nil];
// Recreate the MOC
self.context = [self newManagedObjectContext];
}
- (NSManagedObjectContext *)contextForCurrentThread {
@@ -375,6 +378,7 @@ static RKManagedObjectStore *defaultObjectStore = nil;
name:NSManagedObjectContextDidSaveNotification
object:managedObjectContext];
}
return managedObjectContext;
}