I work through an IOS course at Stanford in the fall of 2011: http://www.stanford.edu/class/cs193p/cgi-bin/drupal/
I get assignment # 3: http://www.stanford.edu/class/cs193p/cgi-bin/drupal/system/files/assignments/Assignment%203_2.pdf
As a summary, the preliminary tasks were asked to build a regular calculator, and now this task asks us to push this calculator to the Nav controller and create a segue from this CalculatorViewController for GraphViewController, which will build the function stored in the "CalculatorBrain". This CalculatorBrain was the model for the original CalculatorViewController.
Tip # 5 continues to say that the model for GraphViewController is now different from the CalculatorViewController model, and I can't figure out what it means.
The only way I was able to create a new MVC was to create a protocol in the GraphView (view) of the GraphViewController with an object called the "dataSource" type identifier. And then in GraphViewController: accepting this protocol, instantiating GraphView and setting yourself up as a data source:
-(void) setGraphView:(GraphView *)graphView { _graphView=graphView; self.graphView.dataSource=self; }
And then in the original CalculatoViewController, using prepareForSegue to pass the GraphViewController program:
-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if([segue.identifier isEqualToString:@"Graph"]) { GraphViewController *myGraphViewController = segue.destinationViewController; myGraphViewController.myCalculator=self.myCalcBrain; } }
So this works fine. Therefore, if this works, it means that the GraphViewController model is indeed the original Brain calculator, which he specifically said that it is not!
I mean, not that during segue I assign the calculator property of the Graphviewcontroller to the instance of the calculator model from the original CalculatorViewController, and then using the protocol to return the Y value from the GraphViewController to GraphView, this means that the model for GraphViewController is really the original model CalculatorBrain