I am using statistical collection queries to query data like steps, average walking speed, etc, from the health kit store.
Following is my initial result handler code...
In the last line of code I get the following error message...
Even Meter unit doesn't work. I need to know which is the right HKUnit to get walking speed.
Following is my initial result handler code...
Code Block NSCalendar *calendar = [NSCalendar currentCalendar]; NSDate *endDate = date; NSDate *startDate = [calendar dateByAddingUnit:NSCalendarUnitYear value:-1 toDate:endDate options:0]; [yearlyResults enumerateStatisticsFromDate:startDate toDate:endDate withBlock:^(HKStatistics *result, BOOL *stop) { if (identifier== HKQuantityTypeIdentifierWalkingSpeed) { HKQuantity *quantity = result.averageQuantity; value = [quantity doubleValueForUnit:[HKUnit countUnit]]; } }];
In the last line of code I get the following error message...
Code Block 'Attempt to convert incompatible units: m/s, count'
Even Meter unit doesn't work. I need to know which is the right HKUnit to get walking speed.