Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <Owner>
- <Name>alexpreynolds</Name>
- <ID>123456</ID>
- </Owner>
- <Books>
- <Book>Book One</Book>
- <Book>Book Two</Book>
- ...
- <Book>Book N</Book>
- </Books>
- *** Terminating app due to uncaught
- exception 'NSInvalidArgumentException',
- reason: 'Illegal attempt to establish a
- relationship 'owner' between objects in
- different contexts
- (source = <Book: 0x7803590>
- (entity: Book; id: 0x7802ae0 <x-coredata:///
- Book/t527F06B2-3EB5-47CF-9A29-985B0D3758862>
- ; data: {
- creationDate = 2009-10-12 06:01:53 -0700;
- name = nil;
- nameInitial = nil;
- operations = (
- );
- owner = nil;
- type = 0;
- }) ,
- destination = <Owner: 0x78020a0> (entity:
- Owner; id: 0x3a56f80 <x-coredata://043AF2F0-1AD0-
- 4078-A5E8-E9D7071D67D1/Owner/p1> ; data: {
- books = "<relationship fault: 0x7801bf0 'books'>";
- displayName = alexpreynolds;
- ownerID = 123456;
- }))'
- NSManagedObject *book = // get a book in one MOC
- NSManagedObject *owner = // get an owner in a different MOC
- [[owner mutableSetValueForKey:@"books"] addObject:[owner managedObjectContext:objectWithID:[book objectID]]];
Add Comment
Please, Sign In to add comment