ios - 运行今日扩展时的调试信息

标签 ios ios8 ios8-today-widget

在调试今天的扩展应用程序时获得此调试信息

“主机连接 来自 pid 53 的连接无效”

谁知道这是什么意思?几乎每次调用“widgetPerformUpdateWithCompletionHandler”时都会显示。

最佳答案

NSXPCConnection API 用于在 Xcode 客户端和 iPhone 上的应用程序之间执行进程间连接。所以你不必担心这个。

链接: https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingXPCServices.html

因此可能有 2 个原因导致您的小部件被终止。

  1. 您需要调用 completionHandler(NCUpdateResultNoData);在您的 widgetPerformUpdateWithCompletionHandler 被调用之后,即使没有返回响应。

  2. 您的应用程序因应用程序自动终止而终止。它出于 2 个原因终止小部件/应用程序:

a. It terminates apps that are not being used and allowing the reclamation of resources such as memory.

b. It terminates widgets that use too much memory.

关于ios - 运行今日扩展时的调试信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27011952/

相关文章:

iOS 今日扩展 UITableView

ios - 使用文本中的图像构建 UIViewControllers

ios - EEXIST - 文件存在于工作区/Pod

PHP:向 ios 发送推送通知

ios - 从字符串中获取范围

iOS 8 Today Widget 显示空白几秒钟

iphone - 为什么我的 NSMutableDictionary 在 setObject 中变为空?

ios8 - AppDelegate 中的presentViewController 与iOS8 中的延迟

swift - 连接 Swift 自定义键盘中的按钮时出错

xcode - "This app contains an app extension with an illegal bundle identifier"问题