这是我的代码:
var shareTypes = Set<HKSampleType>()
shareTypes.insert(HKSampleType.categoryType(forIdentifier: .mindfulSession)!)
var readTypes = Set<HKObjectType>()
readTypes.insert(HKObjectType.categoryType(forIdentifier: .mindfulSession)!)
healthStore.requestAuthorization(toShare: shareTypes, read: readTypes) { (success, error) -> Void in
if success {
print("success")
} else {
print("failure")
}
if let error = error { print(error) }
}
在这里我收到错误:错误域 = com.apple.healthkit 代码 = 100“不支持回滚健康数据库。”
找不到有关此错误的任何信息,有人可以帮忙吗?
我使用 Xcode 8.3.3 Swift 3