ios - HKAnchoredObjectQuery 可以在 HealthKit 中查询已删除的 HKSampleType 吗?

标签 ios ios8 healthkit hkhealthstore

我设置了 HKObserverQuery,然后使用 HKAnchoredObjectQuery 检索 HKSampleType 的新添加内容。有没有办法对已删除的 HKSampleType 执行相同的操作? HKObserverQuery 在删除时被调用,但似乎没有任何方法可以找出删除的内容。

谢谢!

最佳答案

从 iOS 9 开始,您可以使用 HKAnchoredObjectQuery 查询 HealthKit 中已删除的样本。使用带有 resultsHandler 参数的新 init 方法。

关于ios - HKAnchoredObjectQuery 可以在 HealthKit 中查询已删除的 HKSampleType 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29636332/

相关文章:

ios - 显示在单独标签上键入的单个字符?

ios - 如何从 NSURLSession 中停止任务或部分

ios - 使用 .lineBreakMode = .byTruncatingMiddle 的 TableView 单元格中的文本溢出 UILabel 容器

ios - 呈现适用于 iOS7 和 iOS8 的半透明 View Controller

ios8 - 无法在 iOS8 设备上运行 Kiwi 测试

ios - 查看AVAudioSession记录权限状态

ios - 使用 AutoLayout,后台 UIView 在运行时隐藏内容,但在设计时不会。为什么?

ios - HKSampleQuery 不返回任何结果,即使有

swift - 如何按日期明智地获取Apple健康数据?

ios - 在 ResearchKit 中捕捉皮疹图像