作者热门文章
- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
在 xcode 8 之前 - 我正在使用以下代码,但它现在不起作用 - 未调用 watch 端的委托(delegate)方法
if WCSession.isSupported() {
let watchSession = WCSession.defaultSession()
watchSession.delegate = self
watchSession.activateSession()
if watchSession.paired && watchSession.watchAppInstalled {
do {
try watchSession.updateApplicationContext(["key1": "value1"])
} catch let error as NSError {
print(error.description)
}
}
}
在上面的代码中,如果条件不满足。
最佳答案
确保您已在两个目标( watch 和手机)中打开群组功能
关于ios - 如何在 xcode 8 中的 watch 和 iphone 之间共享数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40969830/
我是一名优秀的程序员,十分优秀!