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

但是,我无法在HKQuantityTypeIdentifier中找到相应的类型(即HKCategoryValueMenstrualFlow)。

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


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

最佳答案

可用的类型标识符常量在HealthKit constants reference中可用。您要查找的类型标识符是HKCategoryTypeIdentifierMenstrualFlow

关于ios - 在iOS的Health Kit App中显示月经详情,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/36596731/

10-13 04:02