[CoreData] Entity inheritance
[CoreData] Entity inheritance
- Subject: [CoreData] Entity inheritance
- From: Christophe Favergeon <email@hidden>
- Date: Sun, 15 May 2005 20:54:08 +0200
Hello,
I am just learning CoreData and Cocoa Bindings. I am experimenting
with entity inheritance in Core Data.
I have an abstract entity (let's say A). B and C are entities
inheriting from A.
I have created a table view in Interface Builder connected to an
array of managed objects of type A.
Now, I have two buttons allowing me to create managed objects of type
B and C. They are added automatically to the view displaying the
managed object of type A. So, everything is fine so far.
Now, I'd like to be able to edit the attributes of all my entities.
Of course, when I select an entity in my table, it can either be of
type B or C.
And, I have some problems to manage it through bindings.
I have two views : one to edit entities of kind B and one for
entities of kind C. Of course, when an entity of kind B is selected,
I get exceptions raised by the controller for entities of type C
since there B and C are extending the set of attributes of A in
different ways.
It is not a problem since I can disable, in interface builder, the
generation of exceptions for the not applicable keys. And, I have a
delegate object for my table which is reponsible for hiding the view
which is not needed to edit the details of currently selected object.
It is not an elegant solution.
So, I'd like to know if some of you have some suggestions to
implement things in a more elegant way. I'd like to use bindings when
it is possible since it means less code.
In fact, I am still trying to understand when bindings are the best
solutions and when they are not.
Thanks in advance for your help.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden