Created
November 21, 2014 16:24
-
-
Save GregularExpressions/2af43a15cc4aafb3f8f4 to your computer and use it in GitHub Desktop.
moveManagedObjects:ToContext:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSArray*) moveManagedObjects:(NSArray*)managedObjects toContext:(NSManagedObjectContext*)newContext | |
{ | |
NSMutableArray* movedManagedObjects = [NSMutableArray array]; | |
for (NSManagedObject* managedObject in managedObjects) { | |
NSManagedObject* newManagedObject = [newContext objectWithID:managedObject.objectID]; | |
[movedManagedObjects addObject:newManagedObject]; | |
} | |
return movedManagedObjects; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment