解决方法:
1. CABasicAnimation *thisAnimation = [CABasicAnimtaion animationWithKeyPath:@"transform.rotation.z"];
thisAnimation.removedOnCompletion = NO;
/* When true, the animation is removed from the render tree once its * active duration has passed. Defaults to YES. */ @property(getter=isRemovedOnCompletion) BOOL removedOnCompletion;
2. 对UIApplicationWillEnterForegroundNotification增加observer, 然后在其中重启动画...
旧动画直接removeAllAnimations, 然后重新创建和添加动画.
3.
1). 所在类注册监听
[notify addObserver:self selector:@selector(doAnimation:) name:UIApplicationDidBecomeActiveNotification object:nil];
2). 实现自定义的方法doAnimation:,再次方法中添加动画
- (void)doAnimation:(NSNotification *)notify{
.....
[obj addAnimate];
.....
}