• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to add an managedObject to an arrayController and inherit from a superentity ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to add an managedObject to an arrayController and inherit from a superentity ?
      • From: Scott Stevenson <email@hidden>
    • Re: How to add an managedObject to an arrayController and inherit from a superentity ?
      • From: Henrik Nyh <email@hidden>
  • Prev by Date: Re: NSFileManager movePath problem
  • Next by Date: Re: NSFileManager movePath problem
  • Previous by thread: Re: NSFileManager movePath problem
  • Next by thread: Re: How to add an managedObject to an arrayController and inherit from a superentity ?
  • Index(es):
    • Date
    • Thread