GCKRequest 類別
用於追蹤非同步要求的物件。
如需委派通訊協定,請參閱 GCKRequestDelegate。
- 開始時間
- 3.0
繼承 NSObject。
取消要求。
取消要求並不代表該要求不會在接收端完成,只會造成寄件者停止追蹤要求。
- (void) failWithError: |
|
(GCKError *) |
error |
|
失敗要求並修正錯誤,並通知委派代表。
只有在應用程式使用 GCKRequest::requestWithID: Factory 方法建構的 GCKRequest 物件上才能呼叫此方法。如果對架構本身建立的 GCKRequest 物件呼叫這個方法,就會引發例外狀況。
- Parameters
-
error | The error describing the failure. |
- 開始時間
- 3.4
- (void) abortWithReason: |
|
(GCKRequestAbortReason) |
reason |
|
以原因取消要求,並通知委派代表。
只有在應用程式使用 GCKRequest::requestWithID: Factory 方法建構的 GCKRequest 物件上才能呼叫此方法。如果對架構本身建立的 GCKRequest 物件呼叫這個方法,就會引發例外狀況。
- Parameters
-
reason | The reason for the abort. |
- 開始時間
- 3.4
- (GCKRequestID) requestID |
|
readnonatomicassign |
導致要求失敗的錯誤 (如果有的話),否則為 nil
。
此標記可指出這是外部要求,亦即由應用程式建立,而非架構本身的要求。
- 開始時間
- 3.4
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2023-12-02 (世界標準時間)。
[null,null,["上次更新時間:2023-12-02 (世界標準時間)。"],[[["The `GCKRequest` class is used for tracking asynchronous requests made to a Google Cast device."],["Applications can create and manage their own `GCKRequest` objects, or they can use the framework-provided ones."],["`GCKRequest` objects have a delegate that is notified of the request's progress and completion status."],["A `GCKRequest` can be canceled, completed, failed, or aborted, depending on the outcome of the operation it is tracking."],["Each `GCKRequest` has a unique ID and properties indicating its progress, any associated errors, and whether it's an external request."]]],["The GCKRequest class manages asynchronous requests, enabling tracking and control. Key actions include: canceling a request (`cancel`), completing it (`complete`), or failing it with an error (`failWithError:`) or a reason (`abortWithReason:`). Applications can create request objects using `applicationRequest`. Properties like `delegate`, `requestID`, `error`, `inProgress`, and `external` provide request status information. The delegate receives notifications about the request status. These request objects created by applications can be managed by the application using the methods complete, failWithError and abortWithReason.\n"]]