在创建和初始化对象之后,我调用了“SKProductsRequest”类的“start”方法。该对象的委托定义了productsRequest:didReceiveResponse:方法和request:didFailWithError:方法。在方法请求之后:didFailWithError:被调用我收到错误,说“无法连接到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]);
}
答案 0 :(得分:1)
通常它真的很快,最多几秒钟。我猜你在沙盒环境中这样做了,我觉得这个环境真的不可靠,反应迟钝。我不会太担心它,并在几个小时后再试一次。