简体   繁体   English

Apple Watch HealthKit-无法识别的选择器HKHealthStore startWorkoutSession:完成:

[英]Apple watch HealthKit - unrecognized selector HKHealthStore startWorkoutSession:completion:

I try to get heart rate with watch OS2.0 I get this error when i try to start the workout session 我尝试通过手表OS2.0来获取心率,但是在尝试开始锻炼时会出现此错误

Carleep WatchKit Extension[594:91719] -[HKHealthStore startWorkoutSession:completion:]: unrecognized selector sent to instance 0x155b40e0
  • I well added healthkit framework to my project. 我在项目中添加了healthkit框架。
  • I added -all_load and -ObjC in Other linker flags 我在其他链接器标志中添加了-all_load和-ObjC
  • I find this function in healthkit framework when i cmd+click on startWorkoutSession... 我在cmd +单击startWorkoutSession时在healthkit框架中找到此功能...
  • I have iOS 9 and apple watch under watchOS 2.0 我在watchOS 2.0下拥有iOS 9和Apple Watch

I succeed to request authorization for heartRate. 我成功请求heartRate的授权。 I don't know if i need force import of HKHealthstore+HKWorkout category, and i don't know how to do this. 我不知道是否需要强制导入HKHealthstore + HKWorkout类别,我也不知道该怎么做。

If you have an idea about my problem and how to solve this it would be great. 如果您对我的问题以及如何解决这个问题有个好主意,那就太好了。

Regards, 问候,

Ok i found the solution, i just update Xcode 7 to the latest beta version (6). 好的,我找到了解决方案,我只是将Xcode 7更新为最新的Beta版本(6)。 They removed the completion block in startworkoutsession in the last beta of watch os2. 他们在手表os2的最后一个beta版的startworkoutsession中删除了完成块。 My sdk for watch os 2 in Xcode 7 beta 3 was outdated. 我在Xcode 7 beta 3中的手表os 2的SDK已过时。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Apple Healthkit和Watch Simulator - Apple Healthkit and Watch Simulator HKHealthStore deleteObjects报告错误域= com.apple.healthkit代码= 100“事务失败。” - HKHealthStore deleteObjects reporting Error Domain=com.apple.healthkit Code=100 “Transaction failure.” HealthKit和Apple Watch-如何检查锻炼是否在进行? - HealthKit and Apple Watch - How to check if workout is running? 在Apple Watch上从HealthKit请求数据 - Requesting Data From HealthKit on Apple Watch 没有iPhone的Apple Watch上的HealthKit数据存储? - HealthKit data store on the Apple Watch without iPhone? 仅限 iOS Apple HealthKit Apple Watch 步数数据 - iOS Apple HealthKit Apple Watch step data only 在Apple Watch中访问心率传感器-HealthKit不返回该值 - Accessing heart rate sensor in Apple Watch - HealthKit does not return the value 将 HealthKit 添加到 Apple Watch 扩展后应用程序标识符发生冲突 - Conflicting app identifiers after adding HealthKit to Apple Watch Extension 如何在离线模式下使用Apple Watch的HealthKit导入步骤? - How to import steps using HealthKit from Apple watch in offline mode? 如何通过healthkit使用Apple Watch心率更新iOS应用程序? (HealthKit同步) - How to update iOS app with Apple Watch heart rate via healthkit? (HealthKit sync)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM