GCKDeviceManager Protocol - What is the difference between didDisconnectWithError: and didDisconnectFromApplicationWithError:?

GCKDeviceManager Protocol - What is the difference between didDisconnectWithError: and didDisconnectFromApplicationWithError:?

<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;

如果 Chromecast 接收器断开连接或失去与应用程序的连接,是否调用 deviceManager:didDisconnectWithError:,当应用程序尝试与 Chromecast 接收器断开连接时,是否调用 deviceManager:didDisconnectFromApplicationWithError:

调用每个委托方法的用例是什么?

发送方应用程序可以连接到投射设备,连接成功后可以在投射设备上启动接收方应用程序。所以 "connecting to a device" 和 "running an application" 是两个独立的动作,施法设备中的 "stopping the receiver application" 和 "disconnecting" 也是。因此,有这两种不同的方法。