我有一个健康工具包对象,并进行了所有正确的设置;不过,我正在尝试检索健康包的月经数据。
但是,我无法在 HKQuantityTypeIdentifier
中找到相应的类型(即 HKCategoryValueMenstrualFlow
)。
HKCategoryValueMenstrualFlow
包含一些子项,例如 HKCategoryValueMenstrualFlowLight
、HKCategoryValueMenstrualFlowMedium
、HKCategoryValueMenstrualFlowHeavy
。使用以下方法,我编写的代码如下:
-(void)viewDidLoad {
HKHealthStore *healthStore = [[HKHealthStore alloc] init];
HKCategoryType *q=[NSSet setWithObjects:
[HKCategoryType categoryTypeForIdentifier:HKCategoryValueMenstrualFlowHeavy],
[HKCategoryType categoryTypeForIdentifier:HKCategoryValueMenstrualFlowMedium],
[HKCategoryType categoryTypeForIdentifier:HKCategoryValueMenstrualFlowLight],
[HKCategoryType categoryTypeForIdentifier:HKCategoryValueMenstrualFlowUnspecified],nil];
[healthStore requestAuthorizationToShareTypes:shareObjectTypes readTypes: healthStore completion:^(BOOL success, NSError *error) {
if(success == YES) {
}
}
我是这样写的。但我的疑问是如何在健康套件应用程序中显示月经数据的详细信息。请告诉我任何人给我提供任何想法。提前致谢。
最佳答案
可用的类型标识符常量在 HealthKit constants reference 中可用。 .您要查找的类型标识符是 HKCategoryTypeIdentifierMenstrualFlow
。
关于ios - 在 iOS 的 Health Kit App 中显示月经详情,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36596731/