Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7979273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:44:00+00:00 2026-06-04T09:44:00+00:00

I am working my way through the Stanford Fall 2011 iOS course: http://www.stanford.edu/class/cs193p/cgi-bin/drupal/ I

  • 0

I am working my way through the Stanford Fall 2011 iOS course:
http://www.stanford.edu/class/cs193p/cgi-bin/drupal/

I am onto assignment#3:
http://www.stanford.edu/class/cs193p/cgi-bin/drupal/system/files/assignments/Assignment%203_2.pdf

As a summary, prior assignments have asked to build a regular calculator and now this assignment is asking us to push this calculator unto a Nav controller and create a segue from that CalculatorViewController to a GraphViewController that would plot the function stored in the “CalculatorBrain”. This CalculatorBrain was the model for the original CalculatorViewController.

Hint#5 keeps on talking about the fact that now the model for the GraphViewController is different than the model of the CalculatorViewController and I can’t figure out what he means by that.

The only way I have been able to build the new MVC is by creating a protocol in the GraphView (view) of the GraphViewController with an object called “dataSource” of type ID. And then in the GraphViewController: adopting that protocol, instantiating the GraphView and setting itself as the datasource:

-(void) setGraphView:(GraphView *)graphView
  {
  _graphView=graphView;   
  self.graphView.dataSource=self;
  }

And then in the original CalculatoViewController, using the prepareForSegue to pass the program to the GraphViewController:

-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
  if([segue.identifier isEqualToString:@"Graph"])
  {
    GraphViewController *myGraphViewController = segue.destinationViewController;
    myGraphViewController.myCalculator=self.myCalcBrain;
  }
}

So that seems to work fine. So if that works, that means that the GraphViewController’s model is really the original Calculator Brain that he specifically said it is not!

I mean isn’t the fact that, during the segue, I am assigning to the Graphviewcontroller calculator property the calculator model instance from the original CalculatorViewController and then using a protocol to return the Y value from the GraphViewController to the GraphView means that the model for the GraphViewController is really just the original CalculatorBrain model.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:44:02+00:00Added an answer on June 4, 2026 at 9:44 am

    I do believe the model is the “program”, an NSArray object. It can’t be the description of the program cause there is no easy way to compute the “y” value given a NSString. You will have to re-parse the NSString into a stack (NSArray). As such, isn’t it more direct to have the model as an NSArray/program?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working through the CS 193P course from 2011 from Stanford University and
I working my way through the Apress Pro ASP.NET MVC Framework ( http://www.apress.com/book/view/9781430210078 )
I'm teaching myself iOS 5 programming through the Stamford University CS193P class, I just
I'm working my way through the Webform MySQL/Data solution http://nodeone.se/blogg/finally-webform-submission-data-in-views . All the required
I'm working my way through the online MIT lectures for the classic 6.001 course:
I'm currently working my way through this book: http://www1.idc.ac.il/tecs/ I'm currently on a section
So I'm just getting started with Python, and currently working my way through http://diveintopython3.ep.io/
I have been working through the CS106B course from Stanford, and while completing the
I'm working my way through Hartl's Rails Tutorial (http://ruby.railstutorial.org/chapters/sign-in-sign-out#sec:cucumber). I finished through chapter 9
While working my way through the Android tutorials, I came across something I don't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.