ios - 如何使用 xcode 在 ios 上测试后台到前台?

标签 ios xcode debugging background-foreground

在阅读了您在其他帖子中关于后台/前台任务的一些评论后,我需要在我的应用程序从后台返回到前台时查看返回值。问题是当我将应用程序发送到后台(单击 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

步骤

  1. 选择项目的目标

  2. 选择信息标签

  3. 在自定义 iOS 目标属性下,如果您可以看到名为“Application does not run in background”的键,则将其值设置为 NO,否则执行第 4 步。

  4. ADD a key= "Application does not run in background", type= "bolean", value= "NO"

  5. 运行你的项目

enter image description here

关于ios - 如何使用 xcode 在 ios 上测试后台到前台?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31135686/

相关文章:

ios - iOS 10 中的 UIActivityViewController

ios - jquery 移动数据角色页面或内容中的奇怪滚动

iphone - Objective-C - for 循环中的未识别错​​误

c++ - 如何找出依赖于 LIB 文件的 DLL 列表?

ios - UIPanGestureRecognizer:识别对象是否固定在某个区域并且手势识别器状态未结束

ios - 以编程方式调整大小/对齐加载 View

ios - 如何将数据从 UIContainerView 传递到位于同一父 View Controller 中的另一个 UIContainerView?

xcode - 在 Xcode4 项目中包含 C 工具

在本地使用 PhpStorm 进行调试

javascript - 如何使用fiddler调试?