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

  • SEARCH
  • Home
  • 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 7409029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:00:45+00:00 2026-05-29T06:00:45+00:00

I recently started following the online course on iPhone development from Stanford University on

  • 0

I recently started following the online course on iPhone development from Stanford University on iTunes U.

I’m trying to do the homework assignments now for the first couple of lectures. I followed through the walkthrough where I built a basic calculator, but now I’m trying the first assignment and I can’t seem to work it out. It’s a follows:

Add a “C” button that clears everything (for example, the display in your View, the operand stack in your Model, any state you maintain in your Controller, etc.). Make sure 3 7 C 5 results in 5 showing in the display. You will have to add API to your Model to support this feature.

What API do i need to add?

I tried something like this:

- (IBAction)CancelPressed {
    self.Display.text = 0;
}

I know this is wrong. I need some guidance. Thanks in advance..Sorry if the question is stupid..

  • 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-05-29T06:00:47+00:00Added an answer on May 29, 2026 at 6:00 am

    I am also going through the fall 2011 version on iTunesU. Here is the way I accomplished this.

    - (IBAction)clearPressed {
        self.display.text = @"0";
        self.userIsInTheMiddleOfEnteringANumber = NO;
        self.brain = nil;
    }
    

    The only thing is I actually did not have to add API to my model. Because the controller has a CalculatorBrain instance variable I just toss that out, and since we lazily instantiated our brain getter, I’ll get a brand new one (already cleared) next time I call the getter.

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

Sidebar

Related Questions

I recently started following the online course on iPhone development from Stanford University on
I have recently started following the examples from The Little Schemer and when trying
i'm getting the following, which recently started happening (from updates to the Twitter APi
I recently started to develop an iPhone App. Coming from C#, Objective-C has some
I just recently started looking into WatiN and was following the example from http://www.codeproject.com/KB/aspnet/WatiN.aspx
I have recently started using Netbeans with following stack Liferay, icefaces with jBoss. Is
I’ve recently started learning IOCP on Windows and been reading the following article: http://www.codeproject.com/Tips/95363/Another-TCP-echo-server-using-IOCP
I have recently started programming in WPF and bumped into the following problem. I
I have recently started using Zend Studio which has reported as warning the following
Recently the PHP manual started showing the following warning on every mysql function page:

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.