ios - 如何在模拟器中将 iOS 应用程序启动到后台?

标签 ios objective-c iphone launch

documentation (App States and Multitasking) Apple 提供:

If your app is launched into the background instead—usually to handle some type of background event—the launch cycle changes slightly to the one shown in Figure 3-3. The main difference is that instead of your app being made active, it enters the background state to handle the event and then is suspended shortly afterward. When launching into the background, the system still loads your app’s user interface files but it does not display the app’s window.

如何在iOS模拟器中模拟启动应用程序到后台?

如果应用程序启动到后台,是否会调用 UIApplicationDelegate 方法 -applicationDidEnterBackground:

最佳答案

您只需启动应用程序,然后转到模拟器中的主屏幕 - 按 cmd + shift + H,应用程序处于后台状态,并且 - (void)applicationDidEnterBackground:( UIApplication *)application 在 appDelegate 中被调用。

关于ios - 如何在模拟器中将 iOS 应用程序启动到后台?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25883027/

相关文章:

ios - 使用 3rd 方服务的推送通知传递速度?

ios - 导航栏中未显示栏按钮项

ios - 在 iOS 11 中从我的应用程序打开设置应用程序中的特定项目

ios - 图像作为按钮 C4

iphone - 根据文本自动调整 UITextView

ios - 让 CIColorCube 过滤器在 Swift 中工作

iphone - UIFont 和变音符号

objective-c - 查找未使用的图像或覆盖 +imageNamed : to log images not found

iphone - iOS 使用 MPMoviePlayerController 播放视频

iphone - 如何从 NSMutableDictionary 获取给定对象的键?