2016-06-27 15 views
0

xCode 8.0 BetaでwatchOS3にwatchOS2をアップグレードしています.HKWorkoutSessionDelagateに問題があります。イメージを参照してください。HKWorkoutSessionDelagateプロトコルに準拠

enter image description here

修正 - それの提案は、Xcodeのをクラッシュ - 誰でも同様の問題が発生するか、誰もが解決の方向に私を指すことができます - はるかに高く評価されるだろう。

ありがとうございます。

答えて

1

このデリゲートを追加しただけでエラーは発生しませんでした。 Xcode 8.0、Swift 3.0を使用します。

// 
// InterfaceController.swift 
// asf WatchKit Extension 
// 
// Created by Alvin Varghese on 27/06/16. 
// Copyright © 2016 Swift Coder. All rights reserved. 
// 

import WatchKit 
import Foundation 
import HealthKit 

extension InterfaceController : HKWorkoutSessionDelegate 
{ 
    func workoutSession(_ workoutSession: HKWorkoutSession, didChangeTo toState: HKWorkoutSessionState, from fromState: HKWorkoutSessionState, date: Date) 
    { 

    } 

    func workoutSession(_ workoutSession: HKWorkoutSession, didFailWithError error: NSError){ 

    } 
} 


class InterfaceController: WKInterfaceController { 

    override func awake(withContext context: AnyObject?) { 
     super.awake(withContext: context) 

     // Configure interface objects here. 
    } 

    override func willActivate() { 
     // This method is called when watch view controller is about to be visible to user 
     super.willActivate() 
    } 

    override func didDeactivate() { 
     // This method is called when watch view controller is no longer visible 
     super.didDeactivate() 
    } 

} 
関連する問題