【发布时间】:2016-07-30 01:23:38
【问题描述】:
上线
var anchor = HKQueryAnchor(fromValue: Int(HKAnchoredObjectQueryNoAnchor))
我收到红旗错误
无法将“Int”类型的值转换为预期的参数类型“Uint”
我从另一个 Xcode 项目中复制粘贴了代码,这在另一个项目中没有为该行带来任何错误(仅在 watchOS 上读取心率)。
有什么想法吗?
let healthStore = HKHealthStore()
//State of the app - is the workout activated
var workoutActive = false
// define the activity type and location
var workoutSession : HKWorkoutSession?
let heartRateUnit = HKUnit(fromString: "count/min")
var anchor = HKQueryAnchor(fromValue: Int(HKAnchoredObjectQueryNoAnchor))
【问题讨论】: