SKProductsRequestDelegate失败

时间:2010-08-13 06:23:56

标签: ios iphone in-app-purchase storekit

SKProductsRequestDelegate有一个方法:

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response

通常,我发现这些类型的代表将有多种方法来处理多个案例,而不仅仅是成功。例如:

-(void) connection:(NSURLConnection *)connection didFailWithError:(NSError *) error

如何检查此代码是否由于某种原因而失败,例如。用户离线了吗?

SKProductsRequest *productsRequest = [[SKProductsRequest alloc] ... ];
productsRequest.delegate = self;
[productsRequest start];

1 个答案:

答案 0 :(得分:20)

SKProductsRequestDelegate符合SKRequestDelegate协议。

你找到了

- (void)request:(SKRequest *)request didFailWithError:(NSError *)error
- (void)requestDidFinish:(SKRequest *)request