Re: How to add an managedObject to an arrayController and inherit from a superentity ?
Re: How to add an managedObject to an arrayController and inherit from a superentity ?
- Subject: Re: How to add an managedObject to an arrayController and inherit from a superentity ?
- From: Scott Stevenson <email@hidden>
- Date: Tue, 30 Jan 2007 07:22:17 -0800
On Jan 27, 2007, at 11:45 AM, Baron Stephane wrote:
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 think it would be a lot easier to Make PersonByCase not a
subentity, but rather its own entity which has to-one relationships
to a Person and a Case.
It would also have a to-many relationship to "value" objects, like
you mention above.
but i can't the reverse: add a PersonByCase by choosing a Person
which already exist.
I try this:
[arrayPersonsByCase addObject:[arrayPersons selection]]
(arrayController)
The 'selection' method doesn't return the actual object, just a
placeholder. You need to use -selectionIndex to get the location of
the item in the NSArrayController's -arrangedObjects array.
- Scott
_______________________________________________
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