ios – ‘openParentApplication(_:reply :)’已被显式标记为不可用 – Xcode 7 Beta

ios – ‘openParentApplication(_:reply :)’已被显式标记为不可用 – Xcode 7 Beta,第1张

概述更新到 Xcode 7 beta后,我收到以下错误消息:“’openParentApplication(_:reply :)’已被显式标记为不可用在这里”,当运行代码行“WKInterfaceController.openParentApplication” 这是我的实际代码: func getData(messageText: String) { let infoDictionary = 更新到 Xcode 7 beta后,我收到以下错误消息:“’openParentApplication(_:reply :)’已被显式标记为不可用在这里”,当运行代码行“WKInterfaceController.openParentApplication”

这是我的实际代码:

func getData(messageText: String) {    let infoDictionary = ["message" : messageText]    WKInterfaceController.openParentApplication(infoDictionary) {        (replyDictionary,error) -> VoID in        if let castedResponseDictionary = replyDictionary as? [String: String],responseMessage = castedResponseDictionary["message"]        {            print(responseMessage)        }    }}
解决方法 +[WKInterfaceController openParentApplication:]仅与WatchKit1应用程序扩展程序相关,因为使用WatchKit1应用程序扩展名,appex正在手机上运行,​​而不是在手表上运行.

通过WatchKit2应用程序扩展,appex在手表上运行,因此这样的 *** 作不太简单.你可能想要使用WatchConnectivity.framework的-[WCSession sendMessageData:replyHandler:errorHandler:]来做你正在做的事情.

总结

以上是内存溢出为你收集整理的ios – ‘openParentApplication(_:reply :)’已被显式标记为不可用 – Xcode 7 Beta全部内容,希望文章能够帮你解决ios – ‘openParentApplication(_:reply :)’已被显式标记为不可用 – Xcode 7 Beta所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1098474.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存