解決方法:
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];
.....
}