mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-24 04:46:01 +08:00
Recreate the retained MOC reference on store deletion
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user