Manual Binding in NSTableColumn
Manual Binding in NSTableColumn
- Subject: Manual Binding in NSTableColumn
- From: Jonathan Wight <email@hidden>
- Date: Tue, 6 Jan 2004 15:28:42 -0600
I'm trying to construct an NSTableView from a CSV file (represented by
an NSArray of NSDictionaries) and I'm using NSArrayController to link
the view to the data.
Because I don't know how many columns there are in the data I'm
constructing the NSTableColumns manually instead of Interface Builder
and then I'm trying to bind the value of the column to the
"arrangedObjects.name" property of the array controller. As far as I
can tell this is exactly what happens when I create the binding by in
Interface Builder. Here's the code:
[theTableColumn bind:@"value" toObject:outletArrayController
withKeyPath:@"arrangedObjects.name" options:NULL];
Obviously: "theTableColumn" is a new instance of NSTableColumn that has
just been added to the table. "outletArrayController" points to the
NSArrayController that controls the data.
When this is called I get:
[<NSTableColumn 0x4e36f20> valueForUndefinedKey:]: this class is not
key value coding-compliant for the key value.
When I log the results of [theTableColumn exposedBindings] I get these
bindings back: "( fontSize, fontName, minWidth, fontFamilyName,
headerTitle, font, fontItalic, editable, maxWidth, width, fontBold )".
So even though in Interface Builder I can see the "value" binding but I
cannot see it in the list that exposedBindings returns. Is this a bug?
How do a manually bind the value of a NSTableColumn to an
NSArrayController?
Jon.
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.