2016-03-04 68 views
0

<GCKDeviceManagerDelegate> Protocol我看到两个非常相似的方法:GCKDeviceManager协议 - 是什么didDisconnectWithError之间的区别:和didDisconnectFromApplicationWithError :?

/** 
* Called when the connection to the device has been terminated. It is safe to release the 
* GCKDeviceManager object from within this callback. 
* 
* @param deviceManager The device manager. 
* @param error The error that caused the disconnection; nil if there was no error (e.g. intentional 
* disconnection). 
*/ 
- (void)deviceManager:(GCKDeviceManager *)deviceManager 
    didDisconnectWithError:(NSError *)error; 

/** 
* Called when disconnected from the current application. 
* 
* @param deviceManager The device manager. 
* @param error The error that caused the disconnect, or <code>nil</code> if this was a normal 
* disconnect. 
*/ 
- (void)deviceManager:(GCKDeviceManager *)deviceManager 
    didDisconnectFromApplicationWithError:(NSError *)error; 

正所谓deviceManager:didDisconnectWithError:如果Chromecast的接收器断开连接或断开连接的应用程序,并deviceManager:didDisconnectFromApplicationWithError:叫当应用程序试图从Chromecast接收器断开连接?

什么是用例时,各委托方法将被称为?

回答

1

发送者应用程序可以连接到一个铸造设备和在成功连接可以启动铸造装置上的接收器的应用程序。因此,“连接到设备”和“运行的应用程序”是两个不同的动作,因此被“停止接收申请”自投装置和“断开”。因此,有两种独立的方法。

相关问题