mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-30 05:35:40 +08:00
Cleaned up the naming on RKManagedObjectStore to primaryManagedObjectContext and managedObjectContextForCurrentThread
This commit is contained in:
@@ -194,8 +194,8 @@
|
||||
|
||||
NSArray* cloudsData = [NSArray arrayWithObject:[NSDictionary dictionaryWithObject:@"Nimbus" forKey:@"name"]];
|
||||
NSDictionary* mappableData = [NSDictionary dictionaryWithKeysAndObjects:@"name", @"Hurricane", @"clouds", cloudsData, nil];
|
||||
NSEntityDescription* entity = [NSEntityDescription entityForName:@"RKStorm" inManagedObjectContext:objectStore.context];
|
||||
NSManagedObject* storm = [[NSManagedObject alloc] initWithEntity:entity insertIntoManagedObjectContext:objectStore.context];
|
||||
NSEntityDescription* entity = [NSEntityDescription entityForName:@"RKStorm" inManagedObjectContext:objectStore.primaryManagedObjectContext];
|
||||
NSManagedObject* storm = [[NSManagedObject alloc] initWithEntity:entity insertIntoManagedObjectContext:objectStore.primaryManagedObjectContext];
|
||||
RKManagedObjectMappingOperation* operation = [[RKManagedObjectMappingOperation alloc] initWithSourceObject:mappableData destinationObject:storm mapping:stormMapping];
|
||||
NSError* error = nil;
|
||||
BOOL success = [operation performMapping:&error];
|
||||
|
||||
Reference in New Issue
Block a user