Re: Binding to title of NSButtonCell in a table view
Re: Binding to title of NSButtonCell in a table view
- Subject: Re: Binding to title of NSButtonCell in a table view
- From: Quincey Morris <email@hidden>
- Date: Sat, 17 Jul 2010 23:14:37 -0700
On Jul 17, 2010, at 21:45, Gideon King wrote:
> I have some columns in an NSTableView where I need to display NSButtonCells, and I need the titles to be dynamic as the underlying data (in coredata) changes. I can bind the value to an NSTextFieldCell and it all works just fine, but when I try to bind to a buttoncell it says it's not KV compliant for "value" or for "title" - the docs indicate that the "value" is the state, so that would explain that not working, and the other one, "title" is read only.
>
> So I thought I would need to subclass NSButtonCell and expose a new binding, and that there must be some magic to pick that up when binding the column, but that still doesn't work, so I thought I would have to subclass NSTableColumn and expose the binding there, but I'm not sure how that should link to the cell (if I am indeed doing the right thing).
You've got your terminology backwards (at least in part), which may indicate that you've got your binding backwards too.
You don't want to bind *to* the button cell, but to bind the button cell (specifically, the button cell's "title" binding) to some string property of some core data object.
Are you trying to bind in code? If so, you should post the code.
The fact that "title" is read-only is irrelevant to what I gather you're trying to do. All it means is that (after the binding is established) setting the button cell's title property does not propagate via the binding to the string property to which it is bound. But you're not trying to do that anyway.
_______________________________________________
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