gpt4 book ai didi

ios - 第二次调用 openParentApplication 而不是第一次调用 reply

转载 作者:行者123 更新时间:2023-11-29 12:21:40 26 4
gpt4 key购买 nike

我在 WKInterfaceController 和 iOS 中调用 openParentApplication 方法等待来自服务器的响应。然后我想再次使用openParentApplication在iOS中取消等待响应的操作。

但是第一次调用没有调用 reply,所以我第二次调用 openParentApplication 它没有触发 handleWatchKitExtensionRequest。需要等待第一次调用超时,然后第二次调用将在 handleWatchKitExtensionRequest 中触发。

有没有什么方法可以取消第一次调用而不等待回复

最佳答案

documentation确认您的问题:

If you call this method multiple times in quick succession, your calls are serialized so that each subsequent call is delayed until the response from the previous call is received.

要取消您的第一个调用,您可以更改共享 NSUserDefaults 对象中的值并检查父应用程序中的更改。如果更改,第一个调用将被取消。

另一种选择是使用 Darwin notificationsMMWormhole将消息从 WatchKit 发送到您的父应用程序。

关于ios - 第二次调用 openParentApplication 而不是第一次调用 reply,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30453560/

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