如何检测应用程序已启动进入后台状态?不用说普通应用程序无法做到这一点,只有一小部分适当类型的应用程序可以,这不是理想的情况。特别是报亭应用程序可以做到这一点。
最佳答案
很难相信还没有人正确回答这个问题。来自iOS App Progamming Guide :
To determine whether your app is launching into the foreground or background, check the applicationState property of the shared UIApplication object in your application:willFinishLaunchingWithOptions: or application:didFinishLaunchingWithOptions: delegate method. When the app is launched into the foreground, this property contains the value UIApplicationStateInactive. When the app is launched into the background, the property contains the value UIApplicationStateBackground instead. You can use this difference to adjust the launch-time behavior of your delegate methods accordingly.
关于ios - 检测到应用程序启动进入后台状态?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8479903/