阅读背景:

MVC设计模式。 View如何适合它?

来源:互联网 

I have a questions about the Model-View-Controller design Pattern. I understand the model holds the data. I also understand the Controller (View Controllers) implement the logic of the app. For example, if the UIPicker wheel selects row 4, then the View Controller can ask the Model for the 4th object stored in the Model's array. I'm having trouble understanding were the "Views" fit in. I would think that that nib / storyboard file would be classified as the "View". However every view requires that a View Controller be connected to wire up all the outlets to the view. How am I suppose to keep the View and the View Controller separated? Should I wire all the outlets to the "View Class" and then in my View Controller reference my "View" class when implementing the logic of those outlets? Maybe I just need an example where the View and the View Controller handle different tasks. Because otherwise the an extra "View" class doesn't seem to make sense. Is the View of MVC referring to a View Class? How or why would I want to have this View Class separated from my View Controller class?I have a questions about the Model-View-Control




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: