在阅读了您在其他帖子中关于后台/前台任务的一些评论后,我需要在我的应用程序从后台返回到前台时查看返回值。问题是当我将应用程序发送到后台(单击 iphone 上的主页按钮,或单击 XCODE 上的模拟后台获取 -> 调试)时,xcode 停止运行(包括日志)。所以,我无法继续显示 NSLog 消息。
我不知道我是否解释得很好。
最佳答案
Mine does not stop to debug, it still continues when it goes to background(clicking home button) and comes to foreground when clicked in app icon. I think this should be default setting but if its not happening in yours then try this
步骤
选择项目的目标
选择信息标签
在自定义 iOS 目标属性下,如果您可以看到名为“Application does not run in background”的键,则将其值设置为 NO,否则执行第 4 步。
ADD a key= "Application does not run in background", type= "bolean", value= "NO"
运行你的项目
关于ios - 如何使用 xcode 在 ios 上测试后台到前台?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31135686/