• 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
Overriding NSArrayController to be used in a many-to-many RS and NSTable Bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Overriding NSArrayController to be used in a many-to-many RS and NSTable Bindings


  • Subject: Overriding NSArrayController to be used in a many-to-many RS and NSTable Bindings
  • From: Gustavo Pizano <email@hidden>
  • Date: Thu, 17 Dec 2009 18:39:16 +0100

Hello all.

I have a situation. :S.
I have the follow entities and relations: Invoice< >> ItemXInvoice<< > Item..  The Entity ItemXInvoice has attributes quantity and totalItemPrice, and the Item has, descr (description) and unitPrice.

An Instance of NSArrayController for the entity ItemXInvoice

Now I have an NSTable, with 4 columns, Description, Quanity, Unit Price, and TotalPrice.  and its model key path biding to:
Description Column : toItem.descr ,
Quantity : quantity.
UnitPrice: toItem.unitPrice
totalItemPrice: totalItemPrice.

so when I click add, it creates a ManageObject ItemXInvoice and insert it into the NSArrayController, but of course when I try to put something in the columns, Description and UnitPrice,  when I exit the field it disappear because the Item for that ItemXInvoice doesn't exist... (thats what I am thinking, am I right?).

So I guessI have to implement a custom class of NSArrayController, and be this one the class for the Instance of the controller for ItemXItem, then override the method add, and there ... what shall I do?

create the NSEntityDescription for Item and set the relation to what?

I dunno what to do here.. any ideas?

Thanks

Gustavo

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: Overriding NSArrayController to be used in a many-to-many RS and NSTable Bindings
      • From: Quincey Morris <email@hidden>
  • Prev by Date: NSAttributedString fill with gradient
  • Next by Date: Re: Enabling menu items...
  • Previous by thread: Re: NSAttributedString fill with gradient
  • Next by thread: Re: Overriding NSArrayController to be used in a many-to-many RS and NSTable Bindings
  • Index(es):
    • Date
    • Thread