在尝试发送SKProductRequest时无法连接到iTunes Store错误
问题描述:
在创建和初始化对象的“SKProductsRequest”类之后,我已经调用了“start”方法。此对象的委托正在定义productsRequest:didReceiveResponse:方法和请求:didFailWithError:方法。在方法请求:didFailWithError:被调用后,我收到一条错误,提示“无法连接到iTunes Store”。 。我的代码如下:在尝试发送SKProductRequest时无法连接到iTunes Store错误
-(IBAction)sendProductInfoRequest{
NSLog(@"sendProductInfoRequest");
NSSet *identifiersSet=[NSSet setWithObject:[NSString stringWithFormat:@"%@",@"com.hurix.Kitaboo.07APRIL201101"]];
SKProductsRequest *productRequest=[[SKProductsRequest alloc] initWithProductIdentifiers:identifiersSet];
productRequest.delegate=self;
[productRequest start];
NSLog(@"completing sendProductInfoRequest");
}
- (void)request:(SKRequest *)request didFailWithError:(NSError *)error{
NSLog(@"request didFailWithError");
NSLog(@"The product request didFailWithError: %@",[error localizedDescription]);
}
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response{
NSLog(@"yoooo!");
NSLog(@"The product request didReceiveResponse :%@",[response description]);
}
答
通常它的真快,几秒钟最多。我猜你正在沙盒环境中执行此操作,有时我发现它真的不可靠并且没有反应。我不会担心太多,几个小时后再试。