'openParentApplication(_:reply:)'在此处被明确标记为不可用 - Xcode 7 Beta

14

在更新到Xcode 7 beta后,当运行代码行"WKInterfaceController.openParentApplication"时,我收到以下错误消息:" 'openParentApplication(_: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)
        }
    }
}

1
API已经发生了变化,但是有一个迁移指南:https://developer.apple.com/library/watchos/documentation/General/Conceptual/AppleWatch2TransitionGuide/UpdatetheAppCode.html#//apple_ref/doc/uid/TP40015234-CH6-SW1 - Velizar Hristov
1个回答

17

1
兄弟,感谢你的回答,但我们需要一个教程。这里有一个供将来有兴趣的人使用--> http://www.kristinathai.com/watchos-2-tutorial-using-sendmessage-for-instantaneous-data-transfer-watch-connectivity-1/ - Sam B

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接