我有一個包含所有正確設置的健康套件對象;但是,我試圖檢索健康套件的月經數據。在iOS中的健康套件應用程序中顯示月經詳情
但是,我無法找到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) {
}
}
我寫這樣。但我的疑問是如何在健康套件應用程序中顯示月經數據中的細節。請告訴我任何人提供任何想法。提前致謝。
@Unheilig幫助我,如果你有任何想法PLZ告訴我 – satya