I am taking the standard iOS development course CS193P.
In Assignment 3 I was asked to build a Graphing MVC and combine with the Calculator MVC using NavigationController. The problem is, that I do not know, what should be the Model of the Graph MVC?
The hint of the assignment says:
Your new Controller (the graphing one) is just like any other MVC
Controller: it’s going to want to have a Model (what is the Model for
this new Controller, do you think?) and outlets into its View. Before
you go on to do anything else in this assignment, add a @property to
this Controller for its Model (if you proceed without really
understanding what this Controller’s Model is, you might have trouble
implementing the rest of the assignment). Don’t get this Controller’s
Model confused with your CalculatorViewController’s Model. THEY ARE
DIFFERENT. And don’t over-think this. Your new Controller’s Model is
near at hand!
So the model cannot be the id program? What should the model be?
Think about what the graph view controller does: it takes an expression in terms of x, and graphs the value of that expression (y) for each value of x. So what is the data that the graph view controller needs in order to do its task? It needs an expression.
The model for the graph MVC is just an expression.
Your graph view MVC will also need access to a calculator brain method (probably a class method, not an instance method) in order to calculate the value of the expression given a value of x, so you could argue that that’s part of the model too, although that’s not what Paul was getting at.