handling data relations in Core Data
handling data relations in Core Data
- Subject: handling data relations in Core Data
- From: Daniel Child <email@hidden>
- Date: Mon, 16 Feb 2009 00:16:14 -0500
Hi All,
I'm working out some tests one one-to-many and many-to-many relations
between entities. So far things are working well, including the
bindings. But I'm puzzled by the documentation.
http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/CoreData/Articles/cdRelationships.html#/
/apple_ref/doc/uid/TP40001857-SW3
The Core Data Programming Guide has this passage:
Since Core Data takes care of the object graph consistency maintenance
for you, you only need to change one end of a relationship and all
other aspects are managed for you. This applies to to-one, to-many,
and many-to-many relationships....
Are they saying that if you set the relation in one direction, you
don't have to bother doing the inverse?
Let's say I have two tables A and B with a 1:N relation.
Entity A (one table)
Adata (property)
relatedBItem (relationship)
Entity B (many table)
Bdata (property)
relatedAItems (relationship)
And here are some relations between managed objects having Adata
values and Bdata values.
Table A Table B
one a, b, c
two a, b
three d, e
four f, g
Now let's say I'm setting the properties for "a" (an instance of
Entity B). If I say that a's relatedAItem = @"one", then is Core Data
going to automatically set one's relatedBItems to @"a"? If not, what
do they mean by "all other aspects are managed for you"?
Thanks.
Daniel
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden