2016-03-04 44 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

發送者應用程序可以連接到一個鑄造設備和在成功連接可以啓動鑄造裝置上的接收器的應用程序。因此,「連接到設備」和「運行的應用程序」是兩個不同的動作,因此被「停止接收申請」自投裝置和「斷開」。因此,有兩種獨立的方法。

相關問題