Core Data: Multiple entities in same Table View
Core Data: Multiple entities in same Table View
- Subject: Core Data: Multiple entities in same Table View
- From: Desmond <email@hidden>
- Date: Sat, 21 Feb 2009 14:24:07 -0800
Consider two entities
1) Customer having attributes:
Name
Id
Relationship: address (Has one of more Addresses)
2) Address having attributes:
Street
City
Zip
Relationship: customer (Belongs to one or more customer)
Now I would like to have a single Table View to where I can add/ edit the
customer info and *view* (only) the address information. Let's presume that
address entry/ editing is handled through another screen. I have created
two NSArrayControllers corresponding and binded them to each entity. I am
also able to display all Customer info in the NSTableView but I am not sure
how to get address info corresponding to each customer to show up in the
Table View. I can't use "selection" as the "Controller Key" as I want each
row to display it's corresponding address not the one corresponding to the
current selection. I have also tried binding a column to "Customers"
(controller), Controller Key as "arrangedObjects" and "Model Key Path" as
"address.street" but that hasn't worked.
I am sure it's really simple, but no amount of searching/ messing around
has given me a solution. So, how do I get this to work?
Desmond
_______________________________________________
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