Re: CoreData sub-classing
Re: CoreData sub-classing
- Subject: Re: CoreData sub-classing
- From: "Marcus S. Zarra" <email@hidden>
- Date: Fri, 8 Jun 2007 15:09:35 -0600
Your original message implied that you had Circle and Square
classes. If you do not then set the Circle and Square data objects
in the model to your GraphicObject as well. Then they will use that
class instead of NSManagedObject.
Marcus S. Zarra
Zarra Studios LLC
www.zarrastudios.com
Simply Elegant Software for OS X
On Jun 8, 2007, at 3:05 PM, Steve Israelson wrote:
But I do NOT have any such class.
Are you saying in order to make a custom class you must also then
make all the sub-classes?
On 8-Jun-07, at 2:03 PM, Marcus S. Zarra wrote:
Your data model the Circle and Square should be set to the classes
they are (Circle and Square), not to NSManagedObject.
NSManagedObject is the default and you can set them to any
appropriate subclass as you wish.
Marcus S. Zarra
Zarra Studios LLC
www.zarrastudios.com
Simply Elegant Software for OS X
On Jun 8, 2007, at 2:54 PM, Steve Israelson wrote:
I have a CoreData Entity of, say, GraphicObject. It has several
sub-class entities in the data model of Circle and Square.
Now, I want to make an Objective-C subclass of GraphicObject to
cache the graphic image.
In the data model editor I set the class of GraphicObject to my
Objective-C class.
Circle and Square are still set to the class of ManagedObject.
In my code when I add Circle or Square entities to the context, I
get an exception of them being the wrong class.
So, hmm, I set their class to my Objective-C too.
I still get exceptions thrown.
So, my question is, HOW do I have a data model that uses
inheritance and is also implemented using custom classes in
Objective-C?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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