I am using Apple\'s CoreDataBooks
sample application as a basis for pulling data into a secondary managed object context in the background, and then merging tha
I had the same problem and this sentence helped me to solve the error.
You can't have relationships between objects in different managed object contexts. So one way of getting around that is to bring the object into the managed object context.
Here's my code (I replaced the variables to make it work for you):
// Have the owner object and get the managedObjectContext
Owner *owner = [[DataFunctions alloc] getCurrentOwner];
NSManagedObjectContext *context = [owner managedObjectContext];
// Create a book and use the manageObjectContext of owner
Book *book = [NSEntityDescription insertNewObjectForEntityForName:@"Book" inManagedObjectContext:context];
[newQuote setValue: "Book Title" forKey:@"title"];
[newQuote setOwner:owner];
I hope this helps :)