• 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: Ben Trumbull <email@hidden>
  • Date: Thu, 17 Sep 2009 12:43:46 -0700


On Sep 17, 2009, at 9:21 AM, Leon Starr wrote:

So, going back to my example, (and the part everyone disagrees with!) I still don't get it. More importantly, my objc compiler doesn't get it! In the model, Auto.license is properly inherited by the Sedan and Truck subentities. No trouble at all with KVC interactions. 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. But I CAN do [thisTruck valueForKey:@"license"], which also makes perfect sense.

This violates the rule that a subentity must use an Objective-C class that is the same as its superentity, or a subclass of its superentity's Objective-C class.


If the Truck entity is a subentity of Auto, then it may reuse the AutoClass, or a TruckClass which must be a subclass of the AutoClass.

- Ben



_______________________________________________

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


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: Menu shortcuts without modifiers?
  • Next by Date: Reg: outlineView dataSource method outlineView:child:ofItem:
  • Previous by thread: Re: How to create subentity object inheriting from superentity object in core data
  • Next by thread: Catch exception in NSArrayController
  • Index(es):
    • Date
    • Thread