I am setting up an application using the MVC model and I have a query regrading the flow of information from the UI to the data model. What I need to do is place data from the UI in the model, what I have done is write a method in the view which collects the required data in an object and then passes it to the model. The model then takes ownership of the data so that the view can release its ownership. Does this sound sensible?
+1
A:
- The view would not be involved in communicating with the model. That is the job of the controller.
- Neither the view not the view controller would create a custom object that encapsulates data (although common types like strings, arrays, dictionaries etc are usually okay). Instead, the model should generate any custom data encapsulating classes so that it will have complete control over them. After all, the data model will most likely supply data for multiple controllers.
TechZen
2010-04-18 12:58:43
Hi, sorry my mistake, I was referring to the viewController, I guess I am doing it right as the data I am hoping to send is an NSMutableArray.
fuzzygoat
2010-04-18 13:10:02