在 <GCKDeviceManagerDelegate>
Protocol我看到两种非常相似的方法:
/**
* 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 接收器的连接时调用?
调用每个委托(delegate)方法的用例是什么?
最佳答案
发送方应用程序可以连接到转换设备,连接成功后可以在转换设备上启动接收方应用程序。因此,“连接到设备”和“运行应用程序”是两个独立的操作,“停止接收器应用程序”和“断开”与转换设备的连接也是如此。因此,有这两种不同的方法。
关于ios - GCKDeviceManager 协议(protocol) - didDisconnectWithError : and didDisconnectFromApplicationWithError:? 之间有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35800293/