我正在开发苹果手表应用程序。当我运行这个应用程序时,它工作得很好。现在我的问题是,当应用程序进入后台模式时,苹果手表应用程序上的应用程序将自动关闭。我正在用iPhone应用程序编写小代码:
func viewDidLoad() {
if (WCSession.isSupported()) {
let session = WCSession.defaultSession()
session.delegate = self
session.activateSession()
// In your WatchKit exte
我有一个现有的iOS 9.2和watchOS 2.1应用程序,它使用sendMessage和transferUserInfo将数据从iPhone发送到Apple。如果sendMessage失败,我将使用transferUserInfo对数据进行队列,以供以后传递:
// *** In the iOS app ***
self.session.sendMessage(message, replyHandler: nil) { (error) -> Void in
// If the message failed to send, queue it up for future tra
我正在尝试使用iPhone 9中的新WCSession设置我的手表应用程序和我的iOS应用程序之间的通信。
一切进展顺利,将WCSession添加到手表扩展,但一旦我尝试添加相同的东西到我的手机目标,应用程序将不再构建,并给我这个错误。
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_WCSession", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_6