nstableColumn bindings and cells
nstableColumn bindings and cells
- Subject: nstableColumn bindings and cells
- From: Nicolas Berloquin <email@hidden>
- Date: Fri, 16 Apr 2004 16:21:01 +0200
Hello !
I've been banging my head for a couple days on something that I thought
would be soooo simple.
I have a tableView with columns bound via an arraycontroller to some data in
my model.
One of the columns is supposed to show an icon (an NSImage) that is bound to
an NSImage in my model.
This works fine if I use an NSImageCell in IB, but when, for example I want to
replace this with an
NSButtonCell, so that the button image is bound to the same image, the binding
for NSTableColumn's
'value' doesn't reciprocate with the NSButtonCell's 'icon', and 'icon' isn't
available in the column's
bindings...
I get the following error:
2004-04-16 15:18:13.814 choco[763] An uncaught exception was raised
2004-04-16 15:18:13.814 choco[763] [<NSTableColumn 0x32d880>
valueForUndefinedKey:]: this class is not key value coding-compliant for the
key value.
2004-04-16 15:18:13.814 choco[763] *** Uncaught exception:
<NSUnknownKeyException> [<NSTableColumn 0x32d880> valueForUndefinedKey:]: this
class is not key value coding-compliant for the key value.
I tried deriving NSButtonCell to implement getters and setters for "value"
(and ObjectValue) and link them to "icon" by hand, but I still get the same
errors. I even tried to exposeBinding: on @"value"...
It seems to me that the NSTableColumn works with its cells differently
depending on their type, and that it has
some predefined actions with them (like with imagecells etc), but the
documentation doesn't say exactly how
tablecolumns handle bindings. (See how the exception talks about the
NSTableColumn and not the cell)
Actually, what I want to achieve is to have an Icon bound that way that opens
an info window when double-clicked, that's why I went into the NSButtonCell
tests also (instead of simple icon).
- I have a second question (maybe it should be in a separate email?) :
NSOutlineView isn't binding compliant (well it IS, but not throught IB, I
found out that I could bind the dataSource by hand
for example).
I'm using an NSOutlineView to show the details part of a "master-detail"
window.
I'm wondering how I can bind individual columns of this outlineview to the
data returned by my datasource ?
A good example of what I want to do is the find results window in the finder.
Only imagine that I'd show the folder
hierarchy of a selection inside my details view, with the size/date modified
etc in separate columns.
I would like, then, to bind the size column to each file's size, and have it
update when the value is modified.
How should I do this ?
Do you know if NSOutlineView will be binding-compliant any time soon ?
thanks for all your help ^_^
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.