CoreData - Duplicate existing object
问题 Hi would like to duplicate an object from my core data db. Right now I'm using movement2 = [NSEntityDescription insertNewObjectForEntityForName:@"Movement" inManagedObjectContext:self.managedObjectContext]; movement2.name = movement.name; movement2.value = movement.value; movement2.date = movement.date; ... and it works. but... Is there any way to copy all the values of movement to movement2 , in one line of code? 回答1: NSManagedObject, unlike NSObject, provides an API to iterate over its