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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to