OK, so here's my situation :
- I've got an
NSDictionary
, let's call it :myItem
. myItem.valueNames
contains the values that I want to show up in the popupmyItem.values
contains the values the popup must return (e.g. for valueName[0] -> value[0], and so on)myItem.value
contains the current value
How am I suppose to bind that? Even though I've studied the official reference, it still looks a bit obscure...
I'm currently binding :
myItem.valueNames
toContent
myItem.values
toContent Objects
myItem.value
toSelected Value
and... all I've managed is that it shows the valueNames
.
Any ideas?
Your model is a little strange to me. I wouldn't use an NSDictionary, I'd use a custom subclass with KVC/KVO compliant properties for each of these. Also, if the name of each value is a property of the value object itself, there's no need for a separate
valueNames
property. So, with that change, I'd do this:Content
tomodelObject
with a key path ofvalues
Content Values
tomodelObject
with a key path ofvalues.name
Selected Object
tomodelObject
(oryourControllerObject
if that makes more sense) with a key path ofvalue
(I'd name itselectedValue
)