GCKRequest 类
用于跟踪异步请求的对象。
如需了解委托协议,请参阅 GCKRequestDelegate。
- 开始时间
- 3.0
此类继承 NSObject。
取消请求。
取消请求并不能保证请求不会在接收者上完成,这只会导致发送者停止跟踪请求。
- (void) failWithError: |
|
(GCKError *) |
error |
|
使请求失败并显示错误,并相应地通知委托。
此方法只能在应用使用 GCKRequest::requestWithID: 工厂方法构造的 GCKRequest 对象上调用。对框架本身创建的 GCKRequest 对象调用此方法会引发异常。
- Parameters
-
error | The error describing the failure. |
- 开始时间
- 3.4
- (void) abortWithReason: |
|
(GCKRequestAbortReason) |
reason |
|
使用原因中止请求,并相应地通知委托。
此方法只能在应用使用 GCKRequest::requestWithID: 工厂方法构造的 GCKRequest 对象上调用。对框架本身创建的 GCKRequest 对象调用此方法会引发异常。
- Parameters
-
reason | The reason for the abort. |
- 开始时间
- 3.4
- (GCKRequestID) requestID |
|
readnonatomicassign |
一个标记,指示此请求是否为外部请求 - 即由应用创建的请求,而不是由框架本身创建的请求。
- 开始时间
- 3.4
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-12-02。
[null,null,["最后更新时间 (UTC):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"]]