我必须实现哪些用于多任务处理的新应用程序委托方法才能保留旧行为?

发布于 2024-09-08 23:42:34 字数 211 浏览 2 评论 0原文

目前我不想关心多任务处理。我的应用程序背后有一个很长的开发旅程,现在它已经被设计成当用户点击主页按钮时,应用程序就会被杀死。当他回来时,该应用程序看起来就像他离开时一样。

如果我想恢复同样的行为,我必须在应用程序委托中实现哪些方法?我假设我必须处理我的应用程序成为后台应用程序的情况,就像按下主页按钮一样,即调用 applicationWillTerminate 时。这是最简单的方法,对吧?

For the moment I don't want to care about multitasking. My app has a very long development trip behind it, and now it has been engineered that way that when the user hits the home button, the app gets killed. When he comes back, the app appears like he left it.

If I wanted to get this same behavior back, which methods would I have to implement in the app delegate? I assume that I would have to treat the case where my app becomes a background app just like if the home button was pressed, i.e. if applicationWillTerminate was called. That would be the simplest way, right?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

2024-09-15 23:42:34

您需要在 Info.plist 文件中将名为 UIApplicationExitsOnSuspend 的布尔标志设置为 YES。当您这样做时,当用户点击主页按钮时,-applicationWillTerminate 将像平常一样被调用。

You need to set a boolean flag in your Info.plist file called UIApplicationExitsOnSuspend to YES. When you do so, when the user hits the home button, -applicationWillTerminate will get called, as normal.

浴红衣 2024-09-15 23:42:34

在 Info.plist 中将 UIApplicationExitsOnSuspend 设置为 YES。不过,您的客户会讨厌您的应用程序,因为它不支持快速应用程序切换。

Set UIApplicationExitsOnSuspend to YES in your Info.plist. Your customers will hate your app for not supporting fast app switching, though.

水染的天色ゝ 2024-09-15 23:42:34

在 Info.plist 中包含 UIApplicationExitsOnSuspend 键。请参阅 了解更多信息。

Include the UIApplicationExitsOnSuspend key in your Info.plist. See this for more information.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文