Ios ';openParentApplication(回复:)&x27;已在此处明确标记为不可用-Xcode 7 Beta

Ios ';openParentApplication(回复:)&x27;已在此处明确标记为不可用-Xcode 7 Beta,ios,xcode,swift,watchkit,beta,Ios,Xcode,Swift,Watchkit,Beta,在更新到Xcode 7 beta版后,我在运行代码行“WKInterfaceController.openParentApplication”时收到以下错误消息:“openParentApplication(uuz:reply:)”已在此处显式标记为不可用” 这是我的实际代码: func getData(messageText: String) { let infoDictionary = ["message" : messageText] WKInterfaceControll

在更新到Xcode 7 beta版后,我在运行代码行“WKInterfaceController.openParentApplication”时收到以下错误消息:“openParentApplication(uuz:reply:)”已在此处显式标记为不可用”

这是我的实际代码:

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)
        }
    }
}
仅与WatchKit1应用程序扩展相关,因为使用WatchKit1应用程序扩展,appex在手机上运行,而不是在手表上运行


有了WatchKit2应用程序扩展,appex就可以在手表上运行,所以像这样的操作就不那么容易完成了。您可能希望使用WatchConnectivity.framework进行操作。

API已更改,但有一个迁移指南:Dude,谢谢您的回答,但我们需要一个教程。这里有一个给对未来感兴趣的人-->