iOS MVC design question

Status
Not open for further replies.

blue-lion

macrumors member
Original poster
Jan 26, 2010
50
0
Wirelessly posted (Mozilla/5.0 (iPhone; CPU iPhone OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B176 Safari/7534.48.3)

Hi. I have a question regarding the MVC design concept. In most diagrams I have seen ( including material from the stamford lectures) there is no allowance for data to be passed back from the model to the controller. And yet data has to be passed back in order to be passed to  a view,right?. Or maybe I'm mistaking data for communication? 

I have a private model object declared in my main controller as per recommended in the lectures ,but surely  the results have to be fed back from the model to the view(via the controller)?
 

amorya

macrumors 6502
Jun 17, 2007
252
7
Probably what the diagrams are getting at is that the model shouldn't initiate talking to the controller. It can most certainly respond to queries, and you're right, that's the only way you can get data into a view!
 

Sykte

macrumors regular
Aug 26, 2010
223
0
Wirelessly posted (Mozilla/5.0 (iPhone; CPU iPhone OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B176 Safari/7534.48.3)

Hi. I have a question regarding the MVC design concept. In most diagrams I have seen ( including material from the stamford lectures) there is no allowance for data to be passed back from the model to the controller. And yet data has to be passed back in order to be passed to *a view,right?. Or maybe I'm mistaking data for communication?*

I have a private model object declared in my main controller as per recommended in the lectures ,but surely *the results have to be fed back from the model to the view(via the controller)?
Easiest way to think of this is the follow.

Your controller can have a direct association (ownership) of a model or view.

Your view can have a direct association (ownership) to your model and have indirect association (weak link) to your controller.

Your model never directly associations (ownership) with either the controller or view, it can however have an indirect association (weak link, or think observer) with the view or controller.
 

Status
Not open for further replies.