Re: Core Data bindings: add entity to relationship
Re: Core Data bindings: add entity to relationship
- Subject: Re: Core Data bindings: add entity to relationship
- From: Quincey Morris <email@hidden>
- Date: Mon, 9 Aug 2010 12:16:33 -0700
On Aug 9, 2010, at 11:47, James Maxwell wrote:
> The other mistake in my original description is that the Value of the pop-up is bound to [AssignedArticulation_controller arrangedObjects].articulation.name (i.e., not "selection"), which does seem correct, since we don't know the selection yet... (I also tried binding it to the Index, rather than the Value, and this seemed a little closer, since it got rid of "No Value", and actually listed one of the created articulations. But I'm guessing this is just because the default index is assumed to be zero.)
This doesn't sound right. NSPopUpButtonCell doesn't have a "Value" binding. Do you mean "selectedValue"?
NSPopupButton/Cell is hard to configure by bindings simply because you have to very carefully keep track of the correct binding to use. There's content, contentValues and contentObject. And selectedIndex, selectedValue and selectedObject. Using some of the bindings affects the validity of others.
Also, consider what [AssignedArticulation_controller arrangedObjects].articulation.name means. [AssignedArticulation_controller arrangedObjects] is an array, so sending the 'articulation' message to it returns (because of NSArray behavior, nothing directly to do with KVO or bindings) an array containing the result of sending 'articulation' to each of its members. Sending that the 'name' message returns an array of the names of the Articulation objects in it.
That is, it builds a list of names of Articulations that have already been assigned -- likely an empty list when your application starts.
It seems like the content of the menu from which articulations are chosen needs needs to be an array of Articulation.name strings, and has nothing to do with AssignedArticulation.articulation, unless you're doing something a whole lot more obscure.
_______________________________________________
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