mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-21 19:42:59 +08:00
Use removeObjectForKey on deletePersistantStore.
This commit is contained in:
@@ -165,7 +165,7 @@ static NSString* const kRKManagedObjectContextKey = @"RKManagedObjectContext";
|
||||
// Clear the current managed object context. Will be re-created next time it is accessed.
|
||||
NSMutableDictionary* threadDictionary = [[NSThread currentThread] threadDictionary];
|
||||
if ([threadDictionary objectForKey:kRKManagedObjectContextKey]) {
|
||||
[threadDictionary setNilValueForKey:kRKManagedObjectContextKey];
|
||||
[threadDictionary removeObjectForKey:kRKManagedObjectContextKey];
|
||||
}
|
||||
|
||||
[self createPersistentStoreCoordinator];
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
NSString* localBaseURL = [NSString stringWithFormat:@"http://localhost:4567"]; //getenv("RESTKIT_IP_ADDRESS")
|
||||
_objectManager = [[RKObjectManager objectManagerWithBaseURL:localBaseURL] retain];
|
||||
_objectManager.objectStore = [RKManagedObjectStore objectStoreWithStoreFilename:@"RKSpecs.sqlite"];
|
||||
[_objectManager.objectStore deletePersistantStore];
|
||||
[_objectManager registerClass:[RKHuman class] forElementNamed:@"human"];
|
||||
[_objectManager registerClass:[RKHuman class] forElementNamed:@"humans"];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user