SKProductsRequestDelegate failure

試著忘記壹切 提交于 2019-12-19 05:54:26

问题


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];

回答1:


SKProductsRequestDelegate conforms to the SKRequestDelegate protocol.

There you find

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


来源:https://stackoverflow.com/questions/3474384/skproductsrequestdelegate-failure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!