希望应用程序升级到4.0后按下主页按钮时完全退出
我正在开发一个适用于 iOS 4.0 的应用程序。该应用程序最初版本为 2.2.1。我将其升级为通用应用程序,但现在它似乎是多任务处理。当我在运行应用程序时按下菜单按钮时,它不会退出,而是会关闭,但是当我重新启动应用程序时,它会从我离开的地方恢复。我假设这是多任务处理。我想退出,设置里有办法吗?
我的猜测是 iPad 目标升级以某种方式改变了 plist?有什么想法吗?
I am working on an app for iOS 4.0. The app was originally on 2.2.1. I upgraded it to a universal app, but now it seems to be multitasking. When I press the menu button while running the app, instead of exiting it closes, but when I relaunch the app it resumes where I left off. I am assuming this is multitasking. I want it to exit, is there a way in the settings?
My guess is that the iPad target upgrade changed the plist somehow? Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
打开您的 info.plist 文件
添加密钥 UIApplicationExitsOnSuspend 或选择应用程序不在后台运行
将新密钥设置为 YES 或填写复选框
Open your info.plist file
Add The Key UIApplicationExitsOnSuspend or Select Application does not run in background
Set the new key to YES or Fill in the tick box
这不是多任务处理,而是快速应用程序切换,它现在是默认设置,并且是 iOS 4.0 中的首选。
如果禁用它,这意味着每次用户切换到您的应用程序时都必须重新加载它,而不是让它保留在内存中。每次重新加载都会花费更长的时间。
如果您实现 applicationWillEnterForeground: 并刷新视图,而不是强迫用户在应用程序重新加载时等待,那就更好了。
That's not multitasking, that's Fast app switching which is now the default and is preferred in iOS 4.0.
If you disable it, that means you app has to be reloaded every time the user switches to it instead of allowing it to stay in memory. It will take longer to reload it each time.
It would be better if you implement applicationWillEnterForeground: and refresh your view rather than force the user to have to wait while your app reloads.