【发布时间】:2014-08-26 04:28:57
【问题描述】:
当applicationDidEnterBackground 被调用时,如何停止UIDynamicAnimator?另外,如何在applicationWillEnterForeground 中启动计时器?这是我的代码:
在我的游戏视图controller.m
-(void)stoptime
{
[_animator removeAllBehaviors]; //_animator is my UIDynamicAnimator
[time invalidate];
}
在我的app delegate.m
- (void)applicationDidEnterBackground:(UIApplication *)application
{
gameViewController *new=[[gameViewController alloc]initWithNibName:@"gameViewController" bundle:nil];
[new stoptime];
}
【问题讨论】:
标签: ios objective-c xcode ios7 ios6