• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to create subentity object inheriting from superentity object in core data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to create subentity object inheriting from superentity object in core data
      • From: Leon Starr <email@hidden>
References: 
 >Re: How to create subentity object inheriting from superentity object in core data (From: Ben Trumbull <email@hidden>)
 >Re: How to create subentity object inheriting from superentity object in core data (From: Leon Starr <email@hidden>)

  • Prev by Date: Re: +keyPathsForValuesAffecting<Key> not working for a category-implemented property on a CoreData class
  • Next by Date: Re: How to create subentity object inheriting from superentity object in core data
  • Previous by thread: Re: How to create subentity object inheriting from superentity object in core data
  • Next by thread: Re: How to create subentity object inheriting from superentity object in core data
  • Index(es):
    • Date
    • Thread