2013-03-17 23 views
2

我目前遇到了一个奇怪的问题做动画:奇怪!动画完成后,函数一直在调用?

[UIView animateWithDuration:3 
          delay:0 
         options:UIViewAnimationOptionAllowUserInteraction 
        animations:^{lblBonus.alpha=0;} 
        completion:^(BOOL finished){ 
         [lblBonus removeFromSuperview]; 
         NSLog(@"finished"); 
         [self updateNewRecord]; 
         [self clearScreen]; 
         [self btnStartPlaying]; 
         [self.view.layer removeAllAnimations]; 
        }]; 

所有的功能都不停地打电话,直到应用程序的崩溃,但“NSLog的”只显示一个,如果所有的功能被拆除时间:

[UIView animateWithDuration:3 
          delay:0 
         options:UIViewAnimationOptionAllowUserInteraction 
        animations:^{lblBonus.alpha=0;} 
        completion:^(BOOL finished){ 
         NSLog(@"finished"); 
        }]; 

有什么不对?任何人遇到过这个相同的问题?

+0

想必在你完成的方法之一块调用动画再次? – jrturton 2013-03-17 08:23:06

+0

这些方法很可能会自己调用动画代码。找出一个断点来弄清楚。 – 2013-03-17 08:23:13

+0

可能是'[self updateNewRecord]; [self clearScreen]; [self btnStartPlaying];'调用动画 – 2013-03-17 08:34:19

回答

0

是的,我终于发现,动画是由timer..I反复调用必须是太累了,坐在整天在MacBook的前,,,