mos*_*ene 5 xcode objective-c ios watchos watchconnectivity
概述:
WCSession尽管它们已配对,但我无法在手表或手机模拟器上激活在 Xcode Devices 窗口中,我的手表模拟器和手机模拟器是配对的。我可以使用 WatchKit App 方案启动我的手表应用程序(它也启动手机模拟器,但不打开移动应用程序)。然后我通过单击手机模拟器上的应用程序图标来启动我的移动应用程序。
移动应用:
ViewController 工具 WCSessionDelegateviewDidLoad方法中被激活观看应用:
InterfaceController 工具 WCSessionDelegatewillActivate方法中被激活当我运行 WatchKit 应用程序时,会记录以下消息:
[WC] WCSession has not been activated
Run Code Online (Sandbox Code Playgroud)
当我通过单击应用程序图标打开移动应用程序时,我收到以下消息:
[WC] WCSession has not been activated
Apple Watch is not paired
[WC] WCSession has not been activated
WatchKit app is not installed on the paired watch
Run Code Online (Sandbox Code Playgroud)
(我添加了日志语句来显示检查结果isPaired和isWatchAppInstalled移动应用程序中的会话)
我的WCSession激活代码是在我的手机应用程序,并观看应用中的相同:
if ([WCSession isSupported]) {
WCSession *session = [WCSession defaultSession];
session.delegate = self;
[session activateSession];
// print debugging statements about paired watch, etc.
}
Run Code Online (Sandbox Code Playgroud)
有谁知道为什么 WatchConnectivity 没有检测到手机和手表模拟器配对的事实?为什么不WCSession激活?
| 归档时间: |
|
| 查看次数: |
1580 次 |
| 最近记录: |