Re: Copying Core Data relationships
Re: Copying Core Data relationships
- Subject: Re: Copying Core Data relationships
- From: Matteo Manferdini <email@hidden>
- Date: Fri, 7 Jul 2006 20:24:44 +0200
Sorry everyone, I managed to resolve it myself. The problem was that
each relatioship is bidirectional and the object in the relationship
only had a to-one inverse relationship.
Sorry everyone for bothering you with a useless question.
Cheers.
---
Matteo Manferdini
Il giorno 07/lug/06, alle ore 19:22, Matteo Manferdini ha scritto:
Hi, I have problems copyng core data relationships from an object
to another.
I have an abstract entity in my model with a to-many relationship
in it. Then I have two non-abstract entities that inherit from the
abstract one, one of the two used to save copies of instances of
the other entity. Let's say that object O is an instance of one of
the"original" entity and object C is an instance of the "Copy" entity.
When I copy single attributes from O to C everything works fine,
but when I copy the relationship, the references move from object O
to object C, leaving O relationship empty.
The behaviour I want to achieve is to copy the references, not
moving them. The problem arises if i use KVC as this:
[copy setValue:[original valueForKey:@"relationship"]
forKey:@"relationship"]
but it arises even if I traverse the relationship of the original
object with an enumerator and copy each item singularly, like this:
while (obj = [enumerator nextObject])
[copyRelationship addObject:obj];
Why is this happening?
Thank you everyone.
Cheers.
---
Matteo Manferdini
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden