Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SKProductsRequestDelegate failure

The SKProductsRequestDelegate has one single method:

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

Usually, I find these sorts of delegates will have several methods for handling multiple cases, rather than just success. For example:

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

How can I check if this code fails for some reason, eg. the user is offline?

SKProductsRequest *productsRequest = [[SKProductsRequest alloc] ... ];
productsRequest.delegate = self;
[productsRequest start];
like image 474
Ben Williams Avatar asked Aug 13 '10 06:08

Ben Williams


1 Answers

SKProductsRequestDelegate conforms to the SKRequestDelegate protocol.

There you find

- (void)request:(SKRequest *)request didFailWithError:(NSError *)error
- (void)requestDidFinish:(SKRequest *)request
like image 55
Ortwin Gentz Avatar answered Oct 13 '22 06:10

Ortwin Gentz