【发布时间】:2015-10-20 19:01:39
【问题描述】:
我正在使用
-(void)updateHeartRate:(NSArray<__kindof HKSample *> *)samples
从内部手表传感器检索 HearteRate。根据应用在后台(停用)的时间,必须使用以下方法检索几个 heartRateSamples:
if (samples.count>0) {
for (HKQuantitySample *heartRateSample in samples) {
dispatch_async(dispatch_get_main_queue(), ^{
if (heartRateSample) {
NSLog(@"HEART RATE: %@", [@([heartRateSample.quantity doubleValueForUnit:heartRateUnit]) stringValue]);
}
});
}
}
但是如何检索特定样本写入 HealthKit 的日期/时间?
【问题讨论】:
标签: watchkit watchos-2 healthkit