Re: CoreData sub-classing
Re: CoreData sub-classing
- Subject: Re: CoreData sub-classing
- From: Steve Israelson <email@hidden>
- Date: Fri, 8 Jun 2007 14:20:05 -0700
Hmm, I tried that already and it did not work.
I went and tried it again anyway, and now it does work.
Must have spelled the attribute wrong or something.
Thanks.
On 8-Jun-07, at 2:09 PM, Marcus S. Zarra wrote:
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.
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.
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