title: Paused/restarted animation does not call delegate methods
body: <p>I have a CAKeyframeAnimation that calls animationDidStart: and animationDidStop:finished:, as expected, when the animation is allowed to run its course.</p>
  
  <p>When I pause the animation during interruptions (calls, home btn pressed, etc) animationDidStop:finished: fires with a flag of NO, as expected.</p>
  
  <p>However, after restarting the paused animation, animationDidStart: and animationDidStop:finished: are never fired again. The animation does visually continue and complete, but I don't receive the event. I need to know when the animation stops so I can restart my game loop.</p>
  
  <p>I followed <a href="http://developer.apple.com/library/ios/#qa/qa2009/qa1673.html" rel="nofollow">this</a> for the pause/restart of the animation.</p>
  
  <p>Please tell me what am I doing wrong. Thanks!</p>
  
  <pre><code>- (void)takeFlight
  {   
      CAKeyframeAnimation *pathAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
      pathAnimation.calculationMode = kCAAnimationPaced;
      pathAnimation.removedOnCompletion = NO;
      pathAnimation.duration = FLY_ANIM_TIME;
      pathAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
      pathAnimation.delegate = self;
  
      CGPoint endPoint = CGPointMake(self.view.frame.size.width/2, self.view.frame.size.height/3);
      CGMutablePathRef curvedPath = CGPathCreateMutable();
      CGPathMoveToPoint(curvedPath, NULL, xPos, yPos);
      CGPathAddQuadCurveToPoint(curvedPath, NULL, -100.0, -50.0, 200.0, 100.0);
      pathAnimation.path = curvedPath;
      CGPathRelease(curvedPath);
  
      [shipView.layer addAnimation:pathAnimation forKey:@"flyin"];
      shipView.center = endPoint; 
  }
  
  -(void)pauseFlight
  {
      CALayer *layer = (CALayer *)shipView.layer;
      CFTimeInterval pausedTime = [layer convertTime:CACurrentMediaTime() fromLayer:nil];
      layer.speed = 0.0;
      layer.timeOffset = pausedTime;
  }
  
  -(void)resumeFlight
  {   
      CALayer *layer = (CALayer *)shipView.layer;
      CFTimeInterval pausedTime = [layer timeOffset];
      layer.speed = 1.0;
      layer.timeOffset = 0.0;
      layer.beginTime = 0.0;
      CFTimeInterval timeSincePause = [layer convertTime:CACurrentMediaTime() fromLayer:nil] - pausedTime;
      layer.beginTime = timeSincePause;
  }
  
  - (void)animationDidStart:(CAAnimation *)animation
  {
      NSLog(@"anim did start");
  }
  
  - (void)animationDidStop:(CAAnimation *)animation finished:(BOOL)flag
  {   
      NSLog(@"anim did stop, flag is: %d", flag);
  
  }
  </code></pre>