[__NSDate timeIntervalSinceNow]: message sent to deallocated instance
<p>App crashed with the message when hitting rewind twice just to test app on iPhone device <code>[__NSDate timeIntervalSinceNow]: message sent to deallocated instance</code></p>

<pre><code>-(void)pauseTimer{
pauseStart = [[NSDate dateWithTimeIntervalSinceNow:0] retain];

previousFireDate = [[timer fireDate] retain];

[timer setFireDate:[NSDate distantFuture]];
}


-(void)dealloc
{
[audioPlayer release];
[pauseStart release];
[previousFireDate release];
[super dealloc];
}


  -(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;
    }
   } 
   }


 -(void)rewind:(id)sender{
[timer invalidate];
audioPlayer.currentTime = 0;
MainViewController *viewController = [[[MainViewController alloc] init]autorelease];
viewController.view.frame = CGRectMake(0, 0, 320, 480);
[self.view addSubview:viewController.view]; 
[self.view addSubview:toolbar];
[self playpauseAction:_playButton];
}
</code></pre>

<p>when hitting rewind button again and purposely to test app on iphone device app crashes and gives message <strong>[__NSDate timeIntervalSinceNow]: message sent to deallocated instance</strong> </p>

<p>Any ideas what is wrong.</p>

<p>Appreciate help.</p>

<p>Thanks.</p>
