botão de pausa quando pressionado novamente para retomar a recarga de controladores de visualização

estou usandoAVAudioplayer parareproduzir arquivos de áudio, play / pause button para alternar entre reproduzir e pausar eNSTimer comaudio player sincronizarview controllers um após o outro. Eu tenho um total de 10 ou 11view controllers para carregar um após o outro.

Quando o botão play é pressionado na primeira vez que começaNSTimer, começa a jogaraudio file e baseado emNSTimer, os controladores de visualização serão carregados um após o outro. Quando o botão de pausa é pressionado novamente para continuar, ele retoma tudo a partir daquele arquivo de áudio de ponto,NSTimer eview controllers do mesmo ponto em que foi pausado, o que é bom. No entanto, ao mesmo tempo, começa a carregar oview controllers novamente um após o outro desde o início com base emNSTimer o que não é bom.

Ele está recarregando controladores de visualização com esta declaração

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

Então, meu problema é que eu preciso parar o carregamento deview controllers novamente desde o início quando o botão de pausa é pressionado novamente para retomar a reprodução.

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

-(void)pauseTimer{
    pauseStart = [[NSDate dateWithTimeIntervalSinceNow:0] retain];
    previousFireDate = [[timer fireDate] retain];
    [timer setFireDate:[NSDate distantFuture]];
}

-(void)resumeTimer{
    float pauseTime = -1*[pauseStart timeIntervalSinceNow];
    [timer setFireDate:[previousFireDate initWithTimeInterval:pauseTime sinceDate:previousFireDate]];
    [pauseStart release];
    [previousFireDate release];    
}

- (void)displayviewsAction:(id)sender
{  
    First *firstController = [[First alloc] init];
    firstController.view.frame = CGRectMake(0, 0, 320, 480);
    CATransition *transitionAnimation = [CATransition animation];  
    [transitionAnimation setDuration:1];    
    [transitionAnimation setType:kCATransitionFade];    
    [transitionAnimation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]];    
    [self.view.layer addAnimation:transitionAnimation forKey:kCATransitionFade];
    [self.view addSubview:firstController.view];
    [self.view addSubview:toolbar];
    [firstController release];   
    self.timer = [NSTimer scheduledTimerWithTimeInterval:23 target:self selector:@selector(Second) userInfo:nil repeats:NO];     
 }

Alguém pode dar uma idéia sobre como parar o carregamento deview controllers novamente desde o início quando o botão de pausa é pressionado novamente para retomar a reprodução.

questionAnswers(1)

yourAnswerToTheQuestion