Re: Cocoa-dev Digest, Vol 5, Issue 44
Re: Cocoa-dev Digest, Vol 5, Issue 44
- Subject: Re: Cocoa-dev Digest, Vol 5, Issue 44
- From: Daniel Child <email@hidden>
- Date: Sat, 12 Jan 2008 15:32:53 -0500
Thank you.
You say that its "one managed object with the union of properties."
But if you want to set values via KVC, then are the items referenced as:
Super.fieldOne
Super.fieldTwo
SubOne.fieldOne
etc.
for data imported from a file of SubOne records, and
Super.fieldOne
Super.fieldTwo
SubTwo.fieldOne
SubTwo.fieldTwo
etc.
for data imported from a file of SubTwo records?
Also, does this force me to use custom classes instead of
NSManagedObject?
在 Jan 11, 2008,11:48 PM,email@hidden 写道:
If I am going to be importing data
corresponding to type SubOne, and then supplementing that with data
from SubTwo, how exactly does that work. Is a SubOne object a
SuperEntity with an additional attribute?
Yes. The relationship is analogous to a class and its ivars.
The relationship between a managed object and its entity is "is of".
A managed object cannot have multiple entities any more than an
object can have multiple classes.
"has a" relationships are denoted by attributes and relationships.
I haven't seen any indication of
how to handle subentities, or for that matter, an explanation of
whether the attributes in SuperEntity and those in the SubEntities
are considered part of one managed object or of separate managed
objects. So even using KVC it is unclear to me how you would be
referencing superentity and subentity attributes.
It's one managed object with the union of properties.
KVC references the attributes by name as with any other object. You
cannot create multiple properties of the same name within the same
branch of an inheritance hierarchy. In different branches of the
hierarchy, they are simply different attributes with the same name.
_______________________________________________
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