Re: NSTableColumn not usable with binder of class NSTextValueBinder?
Re: NSTableColumn not usable with binder of class NSTextValueBinder?
- Subject: Re: NSTableColumn not usable with binder of class NSTextValueBinder?
- From: Corbin Dunn <email@hidden>
- Date: Tue, 19 Aug 2008 17:03:08 -0700
On Aug 19, 2008, at 3:47 PM, Dave Dribin wrote:
On Aug 19, 2008, at 5:19 PM, Corbin Dunn wrote:
You can in IB3; just double click on the cell...then set the class.
It's not letting me set it to my custom cell. It just beeps (IB
version 3.1, build 670). I think this is because the column is
setup a text field cell, and it will only let me set the class to an
NSTextFieldCell subclass. There's no plain NSCell in the Library
from what I can find.
Yeah, your correct; please log a bug on this and we will try to fix
it. A "hacky" workaround is to temporarily subclass NSTextFieldCell,
then set it in iB, then undo the change. But, the binder will probably
be wrong...so that doesn't help you too much.
Otherwise, you have to manually set up your binding in code after
you set the [tableColumn dataCell]. The binding is specific to the
cell type. If you need a code example, I can dig one up.
Just tried that, too, and now I get the following error in the
console (with -NSBindingDebugLogLevel 1):
Cocoa Bindings: Error accessing bound property value of object
<NSTableColumn: 0x256ca0>: [<NSTableColumn 0x256ca0>
valueForUndefinedKey:]: this class is not key value coding-compliant
for the key value.
Here's my code, which looks very similar to the ManualBindings
sample code:
[column bind:@"value"
toObject:controller
withKeyPath:@"arrangedObjects.whatever"
options:nil];
Again, what's strange is if I change my cell's superclass to be
NSTextFieldCell, this bind: call does not give an error and it all
works. I also tried subclassing NSActionCell, and that works, too.
Is my cell not implementing some method that bindings expects to be
there? Something that is implemented in NSActionCell?
I'm not aware of any specific code for it; NSActionCell is a very
simple subclass. Maybe the bindings code looks for that class
specifically, in order to know when values change.
thanks,
corbin
_______________________________________________
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