Binding an Array Controller to an NSPopUpButtonCell
Binding an Array Controller to an NSPopUpButtonCell
- Subject: Binding an Array Controller to an NSPopUpButtonCell
- From: Fritz Anderson <email@hidden>
- Date: Tue, 10 Feb 2004 15:24:47 -0600
I have a class that implements
- (unsigned) countOfMeasureSystems;
- (NSDictionary *) objectInMeasureSystemsAtIndex: (unsigned) zeroBased;
... a descendant of NSObjectController owning it, and an
NSArrayController referring to the ObjectController's
selection.measureSystems. I am trying to use the controller layer to
populate an NSPopUpButtonCell in an NSTableColumn from the
measureSystems. The bindings seem to provide affordances for doing
this.
My best guess so far, based on mmalcolm crawford's example of running a
single NSPopUpButton with the controller layer, has been
-- Bind the column's "content" to the arrayController.arrangedObjects.
-- Bind the column's "contentValues" to
arrayController.arrangedObjects.name, name being a key guaranteed to be
present in the returned NSDictionary.
-- Made various guesses about how to bind the popup's selected item,
before deciding to simplify the problem by just getting the popup
filled first.
-- Did same with the cell instead of the column, before concluding the
column was the right context for an array operation.
Regardless of what I do, the NIB throws an exception immediately upon
loading, before the table is populated, and before any attempt is made
to access measureSystems:
-------
[<NSTableColumn 0x530140> valueForUndefinedKey:]: this class is not key
value coding-compliant for the key value.
-------
The lack of quotes makes it hard to tell, but I think it means a key
_named "value."_ I don't refer to such a key anywhere. I think the
exception also means that NSTableColumn isn't KVC compliant for
"value." I don't know what I can usefully do about that.
I've also drawn a blank (as to table cells) on mamasam with the
combination "NSArrayController" and "NSPopUpButtonCell."
So I give up. What's the password for this task?
-- F
_______________________________________________
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.