Use removeObjectForKey on deletePersistantStore.

This commit is contained in:
Blake Watters
2011-03-09 22:03:18 -05:00
parent b81b20281d
commit 52ca8588cf
2 changed files with 2 additions and 1 deletions

View File

@@ -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];

View File

@@ -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"];