Conflict between Play and Rewind buttons for updating viewcontrollers
<p><code>AVAudioPlayer</code> is playing audiofile and updating <code>viewcontrollers</code> when play button is hit and it will load <code>viewcontrollers</code> at different timeintervals and if in between user hits rewind button it restarts this whole process but in between  it shows the flow of updating <code>viewcontrollers</code> for play button. How can I stop that when rewind button is hit by the user. I want to program it this way that when user hits rewind button then it should stop the previous ongoing processing of updating <code>viewcontrollers</code> for play button</p>

<pre><code>-(void)rewind:(id)sender{

audioPlayer.currentTime = 0;

[audioPlayer play];

MainViewController *viewController = [[MainViewController alloc] init];

viewController.view.frame = CGRectMake(0, 0, 320, 480);

[self.view addSubview:viewController.view]; 

[self.view addSubview:toolbar];

[viewController release];

self.timer = [NSTimer scheduledTimerWithTimeInterval:11 target:self selector:@selector(displayviewsAction:) userInfo:nil repeats:NO];

}

-(void)playpauseAction:(id)sender 
{

  if  

  ([audioPlayer isPlaying]){

 [sender setImage:[UIImage imageNamed:@"play.png"] forState:UIControlStateSelected];

      [audioPlayer pause];

  } else {

 [sender setImage:[UIImage imageNamed:@"pause.png"] forState:UIControlStateNormal];

      [audioPlayer play];


      self.timer = [NSTimer scheduledTimerWithTimeInterval:11 target:self selector:@selector(displayviewsAction:) userInfo:nil repeats:NO];
  }  

}

- (void)displayviewsAction:(id)sender
{   
FirstViewController *viewController = [[FirstViewController alloc] init];

viewController.view.frame = CGRectMake(0, 0, 320, 480);

[self.view addSubview:viewController.view];

[self.view addSubview:toolbar];

[viewController release];      

  self.timer = [NSTimer scheduledTimerWithTimeInterval:23 target:self selector:@selector(secondViewController) userInfo:nil repeats:NO];     

}   
</code></pre>
