繁体   English   中英

我如何在iOS的Health Kit中编写Blood Type

[英]How do i write Blood Type in Health kit in iOS

我已经正确设置了HKHealthStore对象,并且现在尝试编写用户特征(即出生日期,生物性别,血液类型和Fitzpatrick皮肤类型)。 我在HKQuantityTypeForIdentifier找不到该类型。 如何在Objective-C中将血型写入HealthKit? 我正在尝试以下方法:

int Dateofbirth=20-10-1995;

NSLog(@“%d”, Dateofbirth);

sex=gender;

BloodType= A+ve;

Fitzpatrick Skin Type= something;

HKQuantityType* bodytemp = [HKQuantityType quantityTypeForIdentifier: HKQuantityTypeIdentifier];

您可能必须将HKBloodTypeHKBloodType characteristicTypeForIdentifier:一起HKBloodType

https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HKObjectType_Class/index.html#//apple_ref/occ/clm/HKObjectType/characteristicTypeForIdentifier

血型常数:

typedef enum : NSInteger {
   HKBloodTypeNotSet = 0,
   HKBloodTypeAPositive,
   HKBloodTypeANegative,
   HKBloodTypeBPositive,
   HKBloodTypeBNegative,
   HKBloodTypeABPositive,
   HKBloodTypeABNegative,
   HKBloodTypeOPositive,
   HKBloodTypeONegative,
} HKBloodType;

https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HealthKit_Constants/index.html#//apple_ref/c/tdef/HKBloodType

没有用于修改用户特征的API。 用户必须自己在“运行状况”中更新特征。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM