Okay, my understanding, then, is that the inheritance is just in the
model - makes sense.  If you subclass NSManagedObjects for the parent
and child entities, you need to explicitly declare and synthesize
(dynamically) all common properties you want to access at lower levels
of the hierarchy (at least).

entity inheritance is just in the model. class inheritance still applies normally.

Just to be clear, in the model I've got Entities: Auto, Sedan, Truck
and the parent (Auto) has a common property license.  Now when I get a
pointer to a Sedan or Truck I want the ability to access via
thisTruck.license or thisSedan.license.  In fact, if I end up with a
pointer (Auto *) thisAuto, I want thisAuto.license as well.

To get this to work, without KVC,  I need to declare @property/
@dynamic for license in Auto, Sedan and Truck.  (Can't just put it in
Auto and expect Sedan.license to work).  No big deal unless I have a
bunch of common properties in the parent entity.

No, Objective-C properties are inherited by subclasses. If you use the modeling tools, your model will be created correctly, and your custom NSManagedObject subclasses will have the correct @interface definitions. Even if you need to do all this programmatically, I'd recommend to play with the modeling tools more to see what things are supposed to look like.

- Ben

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to