How to add an managedObject to an arrayController and inherit from a superentity ?
How to add an managedObject to an arrayController and inherit from a superentity ?
- Subject: How to add an managedObject to an arrayController and inherit from a superentity ?
- From: Baron Stephane <email@hidden>
- Date: Sat, 27 Jan 2007 20:45:59 +0100
Hello,
In my app i have 3 entities:
Case
Person
PersonByCase
PersonByCase is a subentity of Person as i want to be able to add the
same Person in different Cases but for each Case i will have to enter
values relatives to each case for each person (as for example a
reference value)
i also want to have the possibility to change value for a person in
the Case window or in the Person manager window and that those changes
will by made available in each case (i use only one
managedObjectContext)
The case have a relationship one to many case --> personsByCase
Actually i manage to add directly a new PersonByCase entity with a
relationship with the Case currently selected. Thats ok
to do so i add a new entity PersonByCase in an arrayController using
the add: method.
Doing this i can see that a new Person entity is created with the same
value as the new PersonByCase entity (for the values that the
subentity inherit from the Parent entity)
but i can't the reverse: add a PersonByCase by choosing a Person which
already exist.
I try this:
[arrayPersonsByCase addObject:[arrayPersons selection]]
(arrayController)
I got an error
I can't find any sample code to do this in the "good" order.
How can i subclass the add: method to that ??
Thanks
S.Baron
_______________________________________________
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