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 13:05:22 -0700
On Aug 9, 2010, at 12:31, James Maxwell wrote:
> Yes, you're right. The Content for the menu is bound to [Articulations_controller arrangedObjects], and Content Values is bound to [Articulations_controller arrangedObjects].name. This works as expected, in that I see the correct set of choices (Articulations_controller manages all the stored articulations, not the assigned ones).
> In terms of the popup, I'm not binding to the cell directly, but rather to the table column -- could that be the problem? I'm binding the Selected Value to [AssignedArticulations_controller arrangedObjects].articulation.name. And that just reverts to "No Value". I tried binding the column to Selected Object [AssignedArticulations_controller arrangedObjects].articulation and this at least **appeared** to work, since the chosen articulation stuck in the menu. But when I ran the assignment in the app it crashed on Articulation valueUndefinedForKey "name", which seemed a bit weird.
>
> So, I haven't been binding the cell itself. I've been under the impression that it's the column that gets bound, not the cell -- so, yes, I meant "Selected Value"...
Again, I was going only on what you said, which was "looking at the IB file, I've noticed that it already is a NSPopUpButtonCell, not a combo". Yes, typically you specify the binding on the table column, not on the cell.
As to the rest of it, I'm lost as to what you're talking about. What does "ran the assignment in the app" mean? What's the exact text of the reported error? There is no such error as "valueUndefinedForKey". Maybe you're referring to "valueForUndefinedKey"?
It sounds like your popup button selection is getting bound to the 'name' property of the Articulation object, and you run into an exception because there's no setter for that property. As I said before, configuring NSPopUpButton bindings is hard.
_______________________________________________
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