Dear Gurus of Cocoa Bindings,
I've created my own subclass of NSController and called exposeBinding for the various bindings available on it. Each binding corresponds exactly with a KVC-compliant pair of methods e.g. array and setArray.
Now I can easily bind arrays of simple values to the binding. However, supposing I have an array of dictionaries, each dictionary with a key of "name", I find I cannot bind to array.name... it fails at runtime with a
[<NSCFArray 0x3b85e0> addObserver:forKeyPath:options:context:] is not supported. Key path: name
On the other hand, this is precisely the technique used for NSPopUpButton's binding contentValues: provided I bind content first to the array, I can bind contentValues to array.name with no problems. If I don't bind the content first, then it fails with the above error.
So the question is: How does NSPopUpButton allow or implement binding its contentValues to an array.name, where name is a field of the dictionary which is an element of array? (Hope that's clear...)
Cheers, Glen Low
--- pixelglow software | simply brilliant stuff www.pixelglow.com aim: pixglen
|