开发者

MVC as used in ObjectiveC programming

I'm confused somewhat by the MVC implementation as used in Objective C programming. What is described as 'Controller' in Objective C tutorials and documentation, I understand as simply a view or mediator. Which is correc开发者_Go百科t?


A model is what holds your application's data — its model of the world.

A view is what interfaces with your user. It displays things and receives input back.

A controller handles the interactions between the other components. It tells a view how to find its content, it responds to changes in the view by updating the relevant parts of the model, and it responds to changes in the model by telling the view what needs updating.


View displays
Model holds data
Controller responds to user events and controls view and model.

Controller can't be a mediator, because view and model do not communicate with each other through it. But it controls them.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜