0

这是我的代码:

    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

4

1 回答 1

1

这表明您之前在此设备上安装了更新版本的 iOS,然后您回滚到旧版本。一般来说,iOS 不支持回滚(尽管系统的某些部分比其他部分处理得更好)。在设备上安装较旧的操作系统之前,您应该始终擦除设备。

于 2017-07-04T15:31:06.997 回答