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 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間: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"]],["上次更新時間: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."]]],[]]