Core Data: Binding to-many relationships thru multiple levels
Core Data: Binding to-many relationships thru multiple levels
- Subject: Core Data: Binding to-many relationships thru multiple levels
- From: Jerry Krinock <email@hidden>
- Date: Tue, 17 Feb 2009 10:06:24 -0800
I am trying to understand how to bind to object properties that are
themselves properties of parent properties.
For example, in Apple's DepartmentAndEmployees sample project, in the
data model I added to the Employee entity a to-many relationship named
'baggage', to a new entity named 'Bag'. 'Bag' has an inverse
relationship to this and also a string attribute 'bagName'.
In the interface, I added an an NSTokenField in the detail-view area,
and also an array controller named 'BaggageController'.
BaggageController's Content Set is bound to the Employee Set array
controller via Controller Key 'selection' and Model Key Path
'baggage', with "Handles Content as Compound Value". I also switched
on its "Prepares Content". The token field's Value is bound to the
BaggageController via Controller Key 'arrangedObjects' and Model Key
Path 'bagName'.
If that was dizzying, here's a little screenshot:
http://dearjerry.home.mindspring.com/Proj/Baggage.png
and here's the whole project:
http://dearjerry.home.mindspring.com/Proj/
DepartmentAndEmpBaggage.zip
Troubles are that if I save the document and then begin typing into
the token field, the document's "dirty dot" gets dirty, but when I tab
out of the token field, the "dirty dot" immediately becomes clean. No
save required. Also, any 'baggage' items that I add are not saved to
the document's xml store. I do not get any warnings, exceptions or
errors while building or running.
It seems to me like all the pieces are in place. What is missing?
Sincerely,
Jerry Krinock
_______________________________________________
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