2011-04-12 179 views
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]); 

}

回答

1

通常它的真快,幾秒鐘最多。我猜你正在沙盒環境中執行此操作,有時我發現它真的不可靠並且沒有反應。我不會擔心太多,幾個小時後再試。

相關問題