What is the cause of this HealthKit error: “An error occurred while adding a sample to the workout”?
问题 I understand why, but the ambiguity of the errors that HealthKit puts out is a total black box. Why am I getting the error: An error occurred while adding a sample to the workout: The operation couldn’t be completed. I've been scouring the web for examples, but most of them are in swift. :( Here's my code: - (NSSet *)dataTypesToRead { HKQuantityType *heartRate = [HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierHeartRate]; return [NSSet setWithObjects:heartRate, nil]; } -