connection from pid 42 invalidated"适用于 iOS 今日小部件-6ren"> connection from pid 42 invalidated"适用于 iOS 今日小部件-我正在开发一个 iOS 今天的小部件,它非常实用。但是,在真实 iOS 设备上运行时,我偶尔会看到: host connection connection from pid 42 invalidat-6ren">
gpt4 book ai didi

ios - "host connection connection from pid 42 invalidated"适用于 iOS 今日小部件

转载 作者:技术小花猫 更新时间:2023-10-29 10:35:29 28 4
gpt4 key购买 nike

我正在开发一个 iOS 今天的小部件,它非常实用。但是,在真实 iOS 设备上运行时,我偶尔会看到:
host connection <NSXPCConnection: 0x538ee0> connection from pid 42 invalidated

这似乎不是什么大问题,只是当发生这种情况时小部件似乎几乎要重新加载,偶尔会在今日屏幕中留下空白,直到 iOS 重绘它并重新加载所有内容。

有没有人遇到过这个?我在我的应用程序中根本没有使用 NSXPCConnection,所以我假设这是框架中内置的东西,但我不确定

最佳答案

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 - "host connection <NSXPCConnection: 0x538ee0> connection from pid 42 invalidated"适用于 iOS 今日小部件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27788833/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com