我想在我的应用程序上实现这个功能,但我似乎不知道如何使用这行代码。
- (void)applicationWillResignActive:(UIApplication *)application {
//our app is going to loose focus since there is an incoming call
[self pauseGame];
}
- (void)applicationDidBecomeActive:(UIApplication *)application{
//the user declined the call and is returning to our app
[self resumeGame];
}
我读过这必须放在 appdelegates 中,但我似乎无法弄清楚当游戏当前在视图控制器中时如何调用我的暂停动作。
谢谢你。