Overriding NSArrayController to be used in a many-to-many RS and NSTable Bindings
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