SKProductsRequestDelegate有一个方法:
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
通常,我发现这些类型的代表将有多种方法来处理多个案例,而不仅仅是成功。例如:
-(void) connection:(NSURLConnection *)connection didFailWithError:(NSError *) error
如何检查此代码是否由于某种原因而失败,例如。用户离线了吗?
SKProductsRequest *productsRequest = [[SKProductsRequest alloc] ... ];
productsRequest.delegate = self;
[productsRequest start];
答案 0 :(得分:20)
SKProductsRequestDelegate
符合SKRequestDelegate
协议。
你找到了
- (void)request:(SKRequest *)request didFailWithError:(NSError *)error
- (void)requestDidFinish:(SKRequest *)request