Lets say I have a view, myView, a view controller, myViewController, and some sort of model object, myModel. Further, lets say the model has two KVO compliant properties, arrayOfPeopleNames
and arrayOfAnimalKinds
(both NSStrings).
In my view I want to have two pop-ups bound to the contents of these two arrays.
My question is, if myController has a reference to myModel, and the dropdown is bound to myViewController is it good practice to set a keypath along the lines of myModel.arrayOfPeopleNames
?
Or do I need to set up an additional NSArray in myViewController which mirrors the one in myModel and bind to that keypath instead?
The former seems a lot simpler from an implementation point of view (I don't have to make the controller array mirror the model array), but I'm wondering about whether it exposes the model to much to the view.
Opinions?