【发布时间】:2016-07-16 17:46:27
【问题描述】:
我 2 天前刚开始学习 swift,所以如果这听起来像一个愚蠢的问题,我提前道歉。
我正在按照本教程从 HealthKit 获取基本用户数据:https://www.natashatherobot.com/healthkit-getting-fitness-data/ 但是当我编译它时,我收到以下错误:
无法转换 NSSet 类型的值?到预期的参数类型 设置
func requestHealthKitAuthorization(dataTypesToWrite: NSSet?, dataTypesToRead: NSSet?) {
healthStore?.requestAuthorizationToShareTypes(dataTypesToWrite, readTypes: dataTypesToRead, completion: { (success, error) -> Void in
if success {
println("success")
} else {
println(error.description)
}
})
}
我尝试了各种我在网上找到的答案,但都没有成功。
任何提示/想法将不胜感激!
【问题讨论】: