强制一个iPhone应用程序退出时,Home键pssed(上iOS4的)$ P $ [英] Forcing an iPhone app to quit when Home button is pressed (on iOS4)

查看:119
本文介绍了强制一个iPhone应用程序退出时,Home键pssed(上iOS4的)$ P $的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不希望我的应用程序切换到任务栏的时候,Home键为pressed。这就是为什么我想它在首页preSS关闭。我添加了这个条目Info.plist文件,但是这并没有改变行为:

I do not want my app to switch to the "task bar" when the Home button is pressed. That's why I would like it to be closed upon Home press. I added this entry to the info.plist file but this does not change the behaviour:

应用程序在后台不运行

(我检查了中...)

我重建了整个应用程序无论是在调试和发布模式,但没有办法。我听说这应该被添加到info.plist中另一个关键的,但我不能用X code添加:

I rebuilt the whole app both in debug and release mode but no way. I heard of another key which should be added to the info.plist but I cannot add it through Xcode:

UIApplicationExitsOnSuspend

UIApplicationExitsOnSuspend

什么是做正确的方式?

问候,

弗朗茨

推荐答案

在iOS 4的多任务是指X code项目,默认情况下启用。这prevents被称为 applicationWillTerminate 方法。如果您不想支持多任务,地点 UIApplicationExitsOnSuspend 在MyAppName-Info.plist文件并勾选。如果你想支持它,放置在 applicationDidEnterBackground 委托方法的任何code你想要的应用程序进入非激活状态之前执行。

On iOS 4, multitasking is enabled in Xcode projects by default. This prevents the applicationWillTerminate method from being called. If you do not want to support multitasking, place UIApplicationExitsOnSuspend in your MyAppName-Info.plist file and check the checkbox. If you do want to support it, place any code in the applicationDidEnterBackground delegate method that you want to execute before the application enters an inactive state.

这篇关于强制一个iPhone应用程序退出时,Home键pssed(上iOS4的)$ P $的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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