2016-10-20 29 views
1

我的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。

我得到以下錯誤。有什麼我在這裏做了可怕的錯誤,還是有另一種方式來測試游泳訓練課程?

*無法創建鍛鍊時段:游泳會話不支持此設備*

回答

1

無法在Apple Watch模擬器上測試游泳訓練。您必須使用Series 2硬件進行測試。

1

上在說明明顯,你可以測試它在實際手錶的風險?

我從來沒有嘗試過在這裏做什麼,但是有很多其他功能在仿真器上不被支持 - 並且看到了這裏出現的錯誤信息。

對不起,我不能幫助更多

+0

是的 - 但這是模擬器正確的問題......或者可能是設置的組合?不確定 - 關閉升級我的手錶。 – MagicFlow