我的HKWorkout會話設置配置如下:WatchKit/Healthkit - 無法創建一個游泳HKWorkout會話
self.configuration = [[HKWorkoutConfiguration alloc] init];
self.configuration.activityType = HKWorkoutActivityTypeSwimming;
self.configuration.locationType = HKWorkoutSessionLocationTypeOutdoor;
self.configuration.swimmingLocationType = HKWorkoutSwimmingLocationTypeOpenWater;
HKWorkoutSession *session = [[HKWorkoutSession alloc] initWithConfiguration:self.configuration error:&error];
if (error)
{
NSLog(@"Error with Healthkit Session: %@", error);
}
if (session == nil)
{
NSLog(@"*** Unable to create the workout session: %@ ***", error.localizedDescription);
abort();
}
我使用的Xcode 8,但對於這個問題也出現在模擬器Xcode 8 beta 3也是如此。當然使用Apple Series 2 Watch Simulator。
我得到以下錯誤。有什麼我在這裏做了可怕的錯誤,還是有另一種方式來測試游泳訓練課程?
*無法創建鍛鍊時段:游泳會話不支持此設備*
是的 - 但這是模擬器正確的問題......或者可能是設置的組合?不確定 - 關閉升級我的手錶。 – MagicFlow