Connect Multiple Buttons: Rewind & Play/pause button for one action
<p>I have multiple UIButtons in my app. Want to connect Rewind &amp; play/pause Button for one action. Not using interface builder at all for app. </p>

<p>Right now rewind button has this method when it is pressed</p>

<pre><code>-(void)rewind:(id)sender{
[timer invalidate];    
audioPlayer.currentTime = 0;
MainViewController *viewController = [[MainViewController alloc] init];
viewController.view.frame = CGRectMake(0, 0, 320, 480);
[self.view addSubview:viewController.view]; 
[self.view addSubview:toolbar];
[viewController release];
[audioPlayer play];
 self.timer = [NSTimer scheduledTimerWithTimeInterval:11.0
 target:self
 selector:@selector(displayviewsAction:)
 userInfo:nil
 repeats:NO];
}
</code></pre>

<p>and play/pause button has this method when it is pressed</p>

<pre><code>-(void)playpauseAction:(id)sender {
if([audioPlayer isPlaying])
{
    [sender setImage:[UIImage imageNamed:@"Play Icon.png"] forState:UIControlStateSelected];
    [audioPlayer pause];
    [self pauseTimer];
    [self pauseLayer:self.view.layer];
}else{
    [sender setImage:[UIImage imageNamed:@"pause.png"] forState:UIControlStateNormal];
    [audioPlayer play];
    [self resumeTimer];
    [self resumeLayer:self.view.layer];
  if(isFirstTime == YES)
    {
        self.timer = [NSTimer scheduledTimerWithTimeInterval:11.0
                                                      target:self
                                                    selector:@selector(displayviewsAction:)
                                                    userInfo:nil
                                                     repeats:NO];
        isFirstTime  = NO;
    }
   } 
   }
</code></pre>

<p>When the rewind button is pressed, it should do the play/pause action method, means, when rewind button is pressed then play/pause button should toggle to pause button and when pause button is resumed, then it should toggle to play button.</p>
