GCKDevice 类
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
继承自 NSObject、<NSCopying> 和 <NSCoding>。
- (BOOL) isSameDeviceAs: |
|
(const GCKDevice *) |
other |
|
测试此设备是否与另一设备指代同一实体设备。
如果两个 GCKDevice 对象具有相同的类别、设备 ID、IP 地址、服务端口和协议版本,则返回 YES
。
- (BOOL) hasCapabilities: |
|
(NSInteger) |
deviceCapabilities |
|
如果设备支持给定的功能,则返回 YES
。
- Parameters
-
- (void) setAttribute: |
|
(NSObject< NSCoding > *) |
attribute |
forKey: |
|
(NSString *) |
key |
|
|
| |
在对象中设置任意属性。
可供自定义设备提供商用于存储非 Cast 设备的设备特定信息。
- Parameters
-
attribute | The attribute value, which must be key-value coding compliant, and cannot be nil . |
key | The key that identifies the attribute. The key is an arbitrary string. It cannot be nil . |
- (NSObject<NSCoding> * __nullable) attributeForKey: |
|
(NSString *) |
key |
|
查找对象中的属性。
- Parameters
-
key | The key that identifies the attribute. The key is an arbitrary string. It cannot be nil . |
- 返回
- 相应属性的值;如果不存在此类属性,则为
nil
。
- (void) removeAttributeForKey: |
|
(NSString *) |
key |
|
从对象中移除属性。
- Parameters
-
key | The key that identifies the attribute. The key is an arbitrary string. It cannot be nil . |
- (void) removeAllAttributes |
|
|
|
设备的 IPv4 地址,采用点分表示法。
用于发出网络请求时。
- (NSString*) friendlyName |
|
readwritenonatomiccopy |
设备的易记名称。
这是用户可分配的名称,例如“客厅”。
- (NSString*) manufacturer |
|
readwritenonatomiccopy |
当前正在运行的接收方应用报告的状态文本(如果有)。
- (NSString*) deviceVersion |
|
readwritenonatomiccopy |
- (BOOL) isOnLocalNetwork |
|
readnonatomicassign |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-26。"],[[["The `GCKDevice` class represents a Cast receiver device, providing properties for device identification, status, and capabilities."],["It offers methods to check device capabilities, compare devices, and manage custom attributes."],["Device properties include IP address, service port, device ID, friendly name, model name, icons, status, and more."],["Developers can use instance methods to interact with device attributes, determine if two devices are the same, and check for specific capabilities."],["The class inherits from `NSObject`, `NSCopying`, and `NSCoding`, allowing for object manipulation and persistence."]]],[]]