Re: How to create subentity object inheriting from superentity object in core data
Re: How to create subentity object inheriting from superentity object in core data
- Subject: Re: How to create subentity object inheriting from superentity object in core data
- From: Quincey Morris <email@hidden>
- Date: Thu, 17 Sep 2009 09:49:36 -0700
On Sep 17, 2009, at 09:21, Leon Starr wrote:
But if there is no @property/@dynamic for license in my Truck
subclass, (only in the Auto subclasss) I cannot access
thisTruck.license without getting a compiler error. Which makes
total sense to me since one NSManagedObject subclass (Truck) is not
inheriting from another (Auto) in objc. They each inherit from
NSObject.
Nuh uh.
If the Objective-C classes are "Auto" and "Truck" (which are maybe the
same names as your Core Data entities, although they don't *have* to
match), then Auto *must* be a subclass of NSManagedObject:
@interface Auto : NSManagedObject ...
and Truck *must* be a subclass of Auto:
@interface Truck : Auto ...
That's what Ben meant when he said "class inheritance still applies
normally". The whole point of the exercise is to make the Objective-C
inheritance chain *match* the entity inheritance chain.
_______________________________________________
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