UIApplicationExitsOnSuspend 我还缺少什么吗?

发布于 2024-09-12 20:35:25 字数 208 浏览 6 评论 0原文

所以我知道这已经被打死了,但我仍然想不出解决办法。

我在 Info.plist 中将 UIApplicationExitsOnSuspend 设置为 ,但在模拟器和 iPhone 4 设备上仍然如此,应用程序进入待机状态而不是终止?

还有什么想法可以让它终止吗?也许我需要从应用程序委托中删除一些方法?有什么想法吗?

So I know this has been beaten to death but I still can't figure out a solution.

I have my UIApplicationExitsOnSuspend set to <true/> in the Info.plist and still both in the simulator as well as on an iPhone 4 device, the app goes into standby instead of terminating?

Any ideas of what else could one do to get it to terminate? Perhaps are there methods that I need to remove from the app delegate? Any ideas?

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

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

发布评论

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

评论(6

各自安好 2024-09-19 20:35:25

您是否进行了全新构建,从模拟器和设备中删除了应用程序,然后重新安装?这是影响它的唯一关键。另外,请确保您使用设置为 iOS 4.0 的基本 SDK 进行构建。

UIApplicationExitsOnSuspend(布尔值 - iOS)指定应用程序退出时应终止而不是移动到后台。与 iPhone SDK 4.0 或更高版本链接的应用程序可以包含此键并将其值设置为 YES,以防止自动选择后台执行和应用程序挂起。当此键的值为 YES 时,应用程序将终止并从内存中清除,而不是移动到后台。如果此键不存在或设置为“否”,则应用程序将照常移至后台。

Did you do a clean build, delete the app from both the simulator and the device, and re-install? That's the only key that affects it. Also, make sure you are building with base SDK set to iOS 4.0.

UIApplicationExitsOnSuspend (Boolean - iOS) specifies that the application should be terminated rather than moved to the background when it is quit. Applications linked against iPhone SDK 4.0 or later can include this key and set its value to YES to prevent being automatically opted-in to background execution and application suspension. When the value of this key is YES, the application is terminated and purged from memory instead of moved to the background. If this key is not present, or is set to NO, the application moves to the background as usual.

缪败 2024-09-19 20:35:25

我遇到了 Cyril 指出的同样问题:我粘贴了“YES”作为值,但这使得键默认为 String 而不是“Boolean”。因此,右键单击该键并确保其类型为布尔值。

I had the same problem that Cyril identifies: I pasted "YES" in as the value, but that made the key default to String instead of "Boolean". So right-click the key and make sure its type is Boolean.

傲影 2024-09-19 20:35:25

将 YES 设置为 UIApplicationExitsOnSuspend ,从第一次开始对我来说效果很好,但我没有意识到,因为双击时显示了我的应用程序。

“双击主页按钮将始终显示您的应用程序,因为它是最近使用的应用程序的列表。
(参考:http://www.apple.com/iphone/features/multitasking.html< /a> ) "

如果 applicationWillTerminate 委托方法被调用,那么你就完成了..
(添加断点或 NSLog 来检查)

只是一个提示。
希望这对像我这样的人有帮助..;)

Setting YES to UIApplicationExitsOnSuspend , worked well for me from the first time,But i didn realize,as my app was shown when double-clicking.

"double-clicking on the home button will always show your app , as it is a list of recently used apps.
( Ref: http://www.apple.com/iphone/features/multitasking.html ) "

If applicationWillTerminate delegate method is called, then you are done with that..
(Add a break point or NSLog to check )

Just a tip.
Hope this helps some one like me..;)

枯寂 2024-09-19 20:35:25

我遇到了同样的问题,当您添加键 UIApplicationExitsOnSuspend 时,请确保右键单击它并选择值类型>布尔值。否则 Xcode 将忽略它。希望有帮助

I had the same problem, when you add the key UIApplicationExitsOnSuspend, make sure you right click on it and select value type > Boolean. Otherwise Xcode will ignore it. Hope it helps

混吃等死 2024-09-19 20:35:25

这似乎在 Xcode4 / iOS 4.3 中发生了变化(变得更好)。布尔值现在是“应用程序不在后台运行”,而且 - 好吧 - 它对我有用。

This appears to have changed (for the better) in Xcode4 / iOS 4.3. The boolean is now "Application does not run in background", and - well - it works for me.

岁月染过的梦 2024-09-19 20:35:25

值得注意的是,即使您的 UIApplicationExitsOnSuspend 被标记为(布尔值)“YES”,您的 AppDelegate 的“applicationDidEnterBackground”和“applicationWilLTerminate”方法都会被调用(按该顺序)。

It's important to note that your AppDelegate's "applicationDidEnterBackground" and "applicationWilLTerminate" methods are both called (in that order), even if your UIApplicationExitsOnSuspend is marked as (boolean) "YES".

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