应用程序仍在后台运行Xcode 4.2 iOS 5 [英] Application still running in background Xcode 4.2 iOS 5

查看:218
本文介绍了应用程序仍在后台运行Xcode 4.2 iOS 5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用iOS SDK 5.0在Xcode 4.2上编写了一个应用程序。

i wrote an application on the Xcode 4.2 using iOS SDK 5.0.

我已经将info.plist中的UIApplicationexitonsuspend设置为YES但是当我双击家时按钮,应用程序仍在多任务栏中。

i have set the UIApplicationexitonsuspend in the info.plist to YES but when i double press the home button, the application is still in the multitasking bar.

我已经从我的iPhone 4s删除了应用程序,然后从Xcode再次重新发送,但仍然暂停退出不起作用。应用程序仍然存在于多任务选项卡上。

i have deleted the app from my iPhone 4s and resend it again from Xcode but still the exit on suspend does not work. application still lingers on multitasking tab.

推荐答案

您的应用程序图标显示在多任务选项卡中的事实并不意味着你的应用程序仍在那里。

The fact that your app icon is shown in the "multitask tab" does not mean that your app is still there.

多任务选项卡只显示你运行的所有应用程序的列表。

The "multitask tab" simply shows a list of all the apps that you have run.

评估应用程序是否在触摸时重新启动的简单方法是执行以下步骤:

A simple way to assess if an app is launched anew when you touch it, is by doing the following steps:


  1. 启动您的应用;

  1. launch your app;

按主页按钮关闭它;

重新启动应用程序并检查它在启动时显示的图像。如果此图像是您的Default.png图像,则该应用程序将重新启动。如果你发现你的应用程序处于你离开它的状态,那么应用程序就会再次激活(即它在后台)。

relaunch the app and inspect the image that it shows on startup. If this image is your "Default.png" image, then the app was launched anew. If you find your app in the state you left it, then the app was simply made active again (i.e., it was in the background).

查看启动应用程序时会发生什么的更高级方法是在您的应用委托方法中添加 NSLog 跟踪:

A more advanced way to see what happens when you launch your app is put an NSLog trace in your app delegate methods:

- (void)applicationDidEnterBackground:(UIApplication *)application {
}


- (void)applicationWillEnterForeground:(UIApplication *)application {
}

如果你看到打印的痕迹out,那就意味着该应用程序暂停时不会退出。

If you will see the traces printed out, then it means that the app was not quit on suspend.

相反,你可以追踪:

- (void)applicationWillTerminate:(UIApplication *)application {
}

如果在按主页按钮时调用它,则应用程序不会进入后台状态,而是退出。

if it is called when you press the home button, then the app does not enter the background state, rather it quits.

这篇关于应用程序仍在后台运行Xcode 4.2 iOS 5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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