在iOS中的Health Kit App中显示月经详情

我有一个健康工具包对象,所有的设置都正确。 但是,我正在尝试检索健康套件的月经数据。

但是,我无法findHKQuantityTypeIdentifier (即HKCategoryValueMenstrualFlow )中的相应types。

HKCategoryValueMenstrualFlow有一些子项,如HKCategoryValueMenstrualFlowLightHKCategoryValueMenstrualFlowMediumHKCategoryValueMenstrualFlowHeavy 。 使用下面的方法,我写这样的代码:

 -(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) { } } 

我正在这样写。 但我的疑问是如何在健康工具包应用程序中显示月经数据的细节。 请告诉我任何人提供任何想法。 提前致谢。

可用的types标识符常量在HealthKit常量引用中可用。 您正在查找的types标识符是HKCategoryTypeIdentifierMenstrualFlow