Re: Bindings and MVC
Erik Buck <[email protected]> Tue, 11 Jan 2011 18:25:32 -0500
| Newsgroups | gmane.comp.macosx.devel |
|---|---|
| Message-ID | <[email protected]> |
See NSObjectController. NSObjectController *myController; Bind myController's content to a model object or use -setContent or initWithContent. In IB, bind things to myController.selection.<someProperty> If your model has array or dictionary semantics, consider NSArrayController or NSTreeController On Jan 11, 2011, at 3:15 PM, Steve Nicholson wrote: > I have a program I wrote a few years ago in which I was a bad programmer and implemented my model and controller in the same class. Now I'm trying to extract the model from the controller and put each into its own class. I have fields in my NIB bound to properties in the controller. Should I change them to be bound to the model or keep them bound to the controller and have pass-through setters and getters from the controller to the model? > > The former seems to break the model-view-controller separation, but the latter is a whole lot of what seems like redundant code. > > Thanks for any insights, > -Steve > _______________________________________________ > MacOSX-dev mailing list > [email protected] > http://www.omnigroup.com/mailman/listinfo/macosx-dev