Compiler errors xcode8更新错误;类型(控制器)";不符合协议';WCSessionLegate';
更新到Xcode 8后,带有WCSessionDelegate的我的控制器会在viewController上带来类型为“不符合协议WCSessionDelegate”的错误 任何提示?已解决: ViewController下方:UITableViewController,WCSessionDelegate{ 我补充道Compiler errors xcode8更新错误;类型(控制器)";不符合协议';WCSessionLegate';,compiler-errors,xcode8,Compiler Errors,Xcode8,更新到Xcode 8后,带有WCSessionDelegate的我的控制器会在viewController上带来类型为“不符合协议WCSessionDelegate”的错误 任何提示?已解决: ViewController下方:UITableViewController,WCSessionDelegate{ 我补充道 @available(iOS 9.3, *) public func sessionDidBecomeInactive(_ session: WCSession) {
@available(iOS 9.3, *)
public func sessionDidBecomeInactive(_ session: WCSession) {
print ("error in sessionDidBecomeInactive")
}
public func sessionDidDeactivate(_ session: WCSession) {
print ("error in SesssionDidDeactivate")
}
public func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) {
print ("error in activationDidCompleteWith error")
}
已解决:
ViewController下方:UITableViewController,WCSessionDelegate{
我补充道
@available(iOS 9.3, *)
public func sessionDidBecomeInactive(_ session: WCSession) {
print ("error in sessionDidBecomeInactive")
}
public func sessionDidDeactivate(_ session: WCSession) {
print ("error in SesssionDidDeactivate")
}
public func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) {
print ("error in activationDidCompleteWith error")
}
在
sessiondiddactivate
函数中,您应该调用session.activate()(确保您的所有其他代码都已准备好用于活动的监视开关)在sessiondiddactivate
函数中,您应该调用session.activate()(确保您的所有其他代码都已准备好用于活动的监视开关)