title: identify a storyboard uibutton for editting in code
body: <p><strong>update 1</strong></p>
  
  <p>I fixed the problem of the loop not stopping by putting the condition in <code>dealCard</code> instead of in <code>startPause</code>.  </p>
  
  <p><strong>update 1</strong></p>
  
  <p><strong>update 0</strong></p>
  
  <pre><code>- (IBAction)startPause: (UIButton *)sender{
      NSString *buttonTitle = sender.currentTitle;
      if ([buttonTitle isEqualToString: @"Pause"]) {
  
          [self.myButton setTitle:@"Resume" forState:UIControlStateNormal];
          [timer invalidate];
      }
      else
      {
          [self.myButton setTitle:@"Pause" forState:UIControlStateNormal];
          if ([self.deal length]&gt;cardNum) {
              timer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                                       target:self
                                                     selector:@selector(dealCard)
                                                     userInfo:nil
                                                      repeats:YES];
          }
          else
              [timer invalidate];
  
      }
  }
  </code></pre>
  
  <p>In addition to the revised code above, I added a <code>IBOutlet</code> property for <code>myButton</code> as suggested by multiple folks, and changed the <code>NSTimer</code> to <code>repeats:YES</code> from <code>repeats:NO</code>, and I removed the call <code>[self startPause]</code> from <code>dealCard</code>. Now the system seems to work except that the failure of the "while" condition <code>self.deal length]&gt;cardNum</code> does not properly invalidate  the <code>NSTimer</code> in the <code>else</code> clause. </p>
  
  <p>I could use some feedback about why that invalidate is not getting fired.</p>
  
  <p><strong>update 0</strong></p>
  
  <p><a href="https://stackoverflow.com/questions/17055297/no-delay-achieved-with-nstimer/17055382#17055382">Continuing this answered question</a>, I am trying to add the "Pause" part of a "startPause" UIButton. After the button is tapped, I want its title and action to be "Pause", and I want its title to toggle then between "Resume" and "Pause".</p>
  
  <p>The button is created in Storyboard and I cannot think of how to create an identifier for the button so I can alter it programatically. I suspect I need to enhance the button's <code>IBAction</code> method to include "sender" now, but I may be way off.</p>
  
  <p>Currently I have the following unfinished code.</p>
  
  <pre><code>- (IBAction)startPause: (UIButton *)sender{
      NSString *buttonTitle = sender.currentTitle;
      if ([buttonTitle isEqual: @"Pause"]) {
      [myButton setTitle:@"Resume" forState:UIControlStateNormal];   //**** myButton is what?     
  
      if ([self.deal length]&gt;cardNum) {
          timer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                                   target:self
                                                 selector:@selector(dealCard)
                                                 userInfo:nil
                                                  repeats:NO];
      }
      }
  }
  </code></pre>
  
  <p>(I know I have not started the "else" part of the code.)</p>
  
  <p>How do I hook up <code>myButton</code> above with my <code>startPause</code> button in the Storyboard?</p>