I have an array of HKSampleType for steps taken. I am trying to pickup one HKQuantitySample (steps taken) based on matching date. Turns out there is no date property. My code crashes saying there is no key called date, which is true.
How do I pickup one object from the array that is for the date I want.
Here is my code...
NSArray *stepsArray = caloriesHandle.stepsTakenSampleArray;
NSPredicate *stepsPredicate = [NSPredicate predicateWithFormat:@"date=%@",historyDate];
NSArray *stepsPredicateResultsArray = [stepsArray filteredArrayUsingPredicate:stepsPredicate];
when i change the format to @"endDate=%@",historyDate it doesn't return any results.
Could it be because of the time inside the historyDate? if yes, what is the solution.