Re: Binding an Array Controller to an NSPopUpButtonCell
Re: Binding an Array Controller to an NSPopUpButtonCell
- Subject: Re: Binding an Array Controller to an NSPopUpButtonCell
- From: mmalcolm crawford <email@hidden>
- Date: Tue, 10 Feb 2004 15:36:56 -0800
On Feb 10, 2004, at 1:24 PM, Fritz Anderson wrote:
>
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. [...]
>
-- 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.
>
That seems right.
Then bind the column's "selectedObject" to whatever object controller's
selection.measureSystem, I'd guess.
Here's a re-working of the Popups example that uses popups in the
tableview (just to Fritz, the list mailer will strip the attachment):
[demime 0.98b removed an attachment of type application/zip which had a name of Popups2.zip]
>
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.
>
I'd guess something else isn't bound correctly.
mmalc
_______________________________________________
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.