当前位置: 动力学知识库 > 问答 > 编程问答 >

ios4 - iPhone 4 App continues to run in background with debugger

问题描述:

on iphone with multitasking and iOS4.1, if i have the debugger connected i noticed that

code is still being run in the background, my breakpoints are still hit, timers are running.

This without any of the background modes set.

Is it the case that having the debugger connected prevents the app from being suspended?

网友答案:

An app can continue running for a short period of time after it's been suspended. You should use the UIApplicationDelegate methods to check what's going on.

Here's a quote:

applicationDidEnterBackground: Your implementation of this method has approximately five seconds to perform any tasks and return. If you need additional time to perform any final tasks, you can request additional execution time from the system.

网友答案:

Well, since iOS4 there is multitasking. Then, when you enter background, app is still running some things. That's why the debugger is still running ^^

You can avoid multitasking if you want ^^

分享给朋友:
您可能感兴趣的文章:
随机阅读: