【发布时间】:2015-03-16 05:32:18
【问题描述】:
您好,我想在手表套件应用程序上实现示例应用程序。我想显示在 iphone 中运行的父应用程序的一些信息,现在我想通过按钮单击手表套件的预成型操作获取手表套件应用程序中的数据。我已经使用委托方法与扩展应用程序进行后台通信,但是当我在
中打印错误时遇到同样的错误[InterfaceController openParentApplication:dict reply:^(NSDictionary *replyInfo, NSError *error)
{
NSLog(@"%@",[replyInfo objectForKey:@"Key"]);
NSLog(@"error:-%@",[error description]);
}
得到错误....
Error: Error Domain=com.apple.watchkit.errors Code=2 "The UIApplicationDelegate in the iPhone App never called reply() in -[UIApplicationDelegate application:handleWatchKitExtensionRequest:reply:]" UserInfo=0x7f8603227730 {NSLocalizedDescription=The UIApplicationDelegate in the iPhone App never called reply() in -[UIApplicationDelegate application:handleWatchKitExtensionRequest:reply:]}
请建议我如何从扩展应用程序获取手表应用程序中的数据。 提前致谢。
【问题讨论】:
-
转到Appdelegate.m并实现应用程序:handleWatchKitExtensionRequest:reply: method
-
是的,我在应用程序中实现了代码:handleWatchKitExtensionRequest:reply 方法在 appdelegate 方法中,但我仍然遇到同样的错误,并且在调试条件下到达此处理程序方法
-
你有没有通过回复块来观看应用程序?
-
请问是什么意思。以及我们如何在回复块中写请建议
-
是的,我在回复块中传递数据信息并返回字典