Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

specify context into which to import

  • Loading branch information...
commit 19084d06771d2b7eeaab7ace30922a4effe00684 1 parent 65088ba
@casademora casademora authored
View
3  .gitignore
@@ -14,4 +14,5 @@ build/
*.mode1v3
*.mode2v3
-UserInterfaceState.xcuserstate
+UserInterfaceState.xcuserstate
+/Magical Record.xcodeproj/project.xcworkspace/xcuserdata/saul.xcuserdatad/UserInterfaceState.xcuserstate
View
10,353 Magical Record.xcodeproj/project.xcworkspace/xcuserdata/saul.xcuserdatad/UserInterfaceState.xcuserstate
0 additions, 10,353 deletions not shown
View
9 Source/Categories/NSManagedObject+MagicalDataImport.m
@@ -149,11 +149,16 @@ - (void) mr_setValuesForKeysWithJSONDictionary:(NSDictionary *)jsonData
[self mr_setRelationships:relationships forKeysWithJSONDictionary:jsonData];
}
-+ (id) mr_importFromDictionary:(NSDictionary *)data;
++ (id) mr_importFromDictionary:(NSDictionary *)data inContext:(NSManagedObjectContext *)context;
{
- id managedObject = [[self alloc] initWithEntity:[self entityDescription] insertIntoManagedObjectContext:[NSManagedObjectContext defaultContext]];
+ id managedObject = [[self alloc] initWithEntity:[self entityDescription] insertIntoManagedObjectContext:context];
[managedObject mr_setValuesForKeysWithJSONDictionary:data];
return managedObject;
}
++ (id) mr_importFromDictionary:(NSDictionary *)data
+{
+ return [self mr_importFromDictionary:data inContext:[NSManagedObjectContext defaultContext]];
+}
+
@end
Please sign in to comment.
Something went wrong with that request. Please try again.