2
在創建和初始化對象的「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]);
}