title: CS193P Assignment 1 Clear
body: <p>I just started the Stanford iOS5 class and have completed the RPN calculator, but want to make the "Clear" button work a little differently.  This is how I have it now, with no changes to the CalculatorModel "brain":</p>
  
  <pre><code>- (IBAction)clearPressed
  {
      self.display.text = @"";                        // Clear the display
      self.historyWindow.text = @"";                  // Clear the history window
      self.model = nil;                               // Reset the stack
      self.userIsInMiddleOfEnteringNumber = NO;       // Reset user typing boolean
  }
  </code></pre>
  
  <p>I may be wrong, but "self.model = nil;" seems like it doesn't really remove the objects from the stack, it kind of just imitates that.  So I added a function to the CalculatorModel "brain":</p>
  
  <pre><code>-(void) clearOperandStack
  {
      [self.operandStack removeAllObjects];
  }
  </code></pre>
  
  <p>and want to call it in my "clearPressed" function in the CalculatorViewController but I am having issues possibly because I do not fully understand objective c yet.  This is what I thought I had to do, but it does not seem to want to work.</p>
  
  <pre><code>- (IBAction)clearPressed
  {
      self.display.text = @"";                        // Clear the display
      self.historyWindow.text = @"";                  // Clear the history window
  //    self.model = nil;                               // Reset the stack
      [self.model clearOperandStack];
      self.userIsInMiddleOfEnteringNumber = NO;       // Reset user typing boolean
  }
  </code></pre>
  
  <p>Can someone please explain to me the proper way to call that method / what I am doing wrong?</p>