我想知道当用户玩游戏时iphone如何处理这四种可能性。而且你们可以指出更多的可能性。
○用户在单人游戏中收到短信
○用户在多人游戏中接到电话并决定 接听电话。
○用户在单人游戏中间使用主页按钮关闭应用程序。
○用户在应用程序的主菜单上按下锁定按钮,在...之外 一场比赛。
在为此开发代码时,我会遇到哪些问题/问题? 如果有人能够以图解方式解释这一点,那将非常有用。
答案 0 :(得分:0)
此方法位于AppDelegate.m
。当用户退出应用程序,接听电话或收到短信时,会调用此方法:
- (void)applicationWillResignActive:(UIApplication *)application
{
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}