概览
通用 GCKCastChannel 实现,适合在不需要子类化时使用。
GCKGenericChannel 会将消息和连接事件转发给其代理,并且没有自己的处理逻辑。
如需了解委托协议,请参阅 GCKGenericChannelDelegate。
继承 GCKCastChannel。
| 实例方法摘要 | |
| (instancetype) | - initWithNamespace: | 
| 指定的初始化程序。更多... | |
| (instancetype) | - init | 
| 默认初始化程序不可用。更多... | |
| (void) | - didReceiveTextMessage: | 
| 在此频道上收到短信时调用。更多... | |
| (BOOL) | - sendTextMessage:error: | 
| 在此频道上发送短信。更多... | |
| (NSInteger) | - generateRequestID | 
| 为新消息生成请求 ID。更多... | |
| (nullable NSNumber *) | - generateRequestNumber | 
| 一种便捷方法,它将 generateRequestID 的结果封装在 NSNumber 中。更多... | |
| (void) | - didConnect | 
| 在此通道连接时调用,表示现在可以通过此通道与投射设备互发消息。更多... | |
| (void) | - didDisconnect | 
| 在此渠道断开连接时调用,表示无法再通过此渠道与投放设备互发消息。更多... | |
| (void) | - didChangeWritableState: | 
| 在此通道的可写状态发生变化时调用。更多... | |
| 属性摘要 | |
| id< GCKGenericChannelDelegate > | delegate | 
| 代理,用于接收有关频道状态更改的通知。更多... | |
| NSString * | protocolNamespace | 
| 频道的命名空间。更多... | |
| BOOL | isConnected | 
| 指示此频道当前是否已连接的标志。更多... | |
| BOOL | isWritable | 
| 一个标记,指示此通道当前是否可写入。更多... | |
方法详细信息
| - (instancetype) initWithNamespace: | (NSString *) | protocolNamespace | 
指定的初始化程序。
- Parameters
- 
  protocolNamespace The namespace for this channel. This namespace must be unique across all channels used by a given application. 
实现了 GCKCastChannel。
| - (instancetype) init | 
默认初始化程序不可用。
| - (void) didReceiveTextMessage: | (NSString *) | message | 
在此频道上收到短信时调用。
默认实现为空操作。
- Parameters
- 
  message The message. 
| - (BOOL) sendTextMessage: | (NSString *) | message | |
| error: | (GCKError *_Nullable *_Nullable) | error | |
在此频道上发送短信。
- Parameters
- 
  message The message. error A pointer at which to store the error result. May be nil.
- 返回
- 如果成功,则为 YES;如果无法发送消息,则为NO。
| - (NSInteger) generateRequestID | 
为新消息生成请求 ID。
- 返回
- 生成的 ID,如果频道当前未关联,则返回 kGCKInvalidRequestID。
| - (nullable NSNumber *) generateRequestNumber | 
一种便捷方法,它将 generateRequestID 的结果封装在 NSNumber 中。
- 返回
- 生成的 ID,如果频道当前未关联,则返回 nil。
| - (void) didConnect | 
在此通道连接时调用,表示现在可以通过此通道与投射设备互发消息。
默认实现为空操作。
| - (void) didDisconnect | 
在此渠道断开连接时调用,表示无法再通过此渠道与投放设备互发消息。
默认实现为空操作。
| - (void) didChangeWritableState: | (BOOL) | isWritable | 
在此通道的可写状态发生变化时调用。
默认实现为空操作。
- Parameters
- 
  isWritable Whether the channel is now writable. 
- 开始时间
- 4.0
房源详情
| 
 | readwritenonatomicweak | 
代理,用于接收有关频道状态更改的通知。
| 
 | readnonatomiccopyinherited | 
频道的命名空间。
| 
 | readnonatomicassigninherited | 
指示此频道当前是否已连接的标志。
| 
 | readnonatomicassigninherited | 
一个标记,指示此通道当前是否可写入。
- 开始时间
- 4.0