iPhone:为什么在设备上重新启动应用程序后,我的应用程序会继续运行而不恢复? [英] IPhone: Why does my app resume and not restart when I relaunch it on device?

查看:222
本文介绍了iPhone:为什么在设备上重新启动应用程序后,我的应用程序会继续运行而不恢复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道这是iOS4还是其他东西,但基本上是说我的应用中有几个屏幕。现在,当我按下主页按钮并重新启动我的应用程序时,它将在我停下的屏幕上启动该应用程序。几乎就像没有重启我的应用程序一样,而是继续运行它。我不希望它那样做。 (我希望它显示我的启动屏幕主菜单,等等。)

I don't know if this is an iOS4 thing or something, but basically say I have a few screens in my app. Now, when I hit the home button and relaunch my app it launches the app on the screen where I left off. It's almost like it's not restarting my app, but resumes it. I don't want it to do that. (I'd like it to show my splash screen main menu, etc. )

有人知道如何解决吗?谢谢

Does anyone know how to resolve this? thanks

推荐答案

在iOS 4中,按下主屏幕按钮后,应用将被挂起(未终止)。当您重新启动应用程序时,它只是移至前台。如果您希望应用程序在用户按下主页按钮时终止,请将 UIApplicationExitsOnSuspend 的值设置为 YES 应用的 Info.plist 文件。如果这样做,当用户点击主页按钮时,将调用您的应用程序委托的 applicationWillTerminate:方法,然后您的应用程序将终止。

In iOS 4, apps are suspended (not terminated) when the home button is pressed. When you "relaunch" the app, it is simply moved to the foreground. If you want your app to terminate when the user presses the home button, set the value of UIApplicationExitsOnSuspend to YES in your app's Info.plist file. If you do this, when the user taps the home button the applicationWillTerminate: method of your app delegate will be called and then your application will terminate.

这篇关于iPhone:为什么在设备上重新启动应用程序后,我的应用程序会继续运行而不恢复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆