2012-11-21 5 views
4

방금 ​​업데이트를 제출 한 iOS 앱이 있습니다. 애플 리케이션 (시뮬레이터와 내 4S)의 개발 버전은 결코 추락하지 않으며 그것은 잘 작동합니다. 앱은 IAP뿐만 아니라 오늘 승인을 받았지만, 오늘 아침에 iAP가 "구매 승인을받지 못했다"는 것을 깨달았습니다. 방금 구입을 취소했지만 앱이 계속 충돌합니다. 사용 가능한 제품 목록을 요청하면서 문제가 발생앱 구매시 충돌 앱

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse: 
(SKProductsResponse *)response 
{ 
    NSArray *myProduct = response.products; 
    //this line is where the error occurs 
    noAdProduct = [myProduct objectAtIndex:0]; 
    if (![[[NSUserDefaults standardUserDefaults] objectForKey:@"the id here"] boolValue]) { 
     adCell.detailTextLabel.text = [NSString stringWithFormat:@"$%@", noAdProduct.price]; 
     adCell.userInteractionEnabled = YES; 
     adCell.accessoryType = UITableViewCellAccessoryNone; 
     adCell.accessoryView = nil; 
     [self.tableView reloadData]; 
    } 
} 

:

<Error>: *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 0 beyond bounds for empty array'

여기에 그런 일이 코드는 다음과 같습니다 아이폰이주는 오류가 (앱 스토어 버전을 실행) 오류를 제공합니다 이는 분명히 시뮬레이터에서 제품을 반환하지만 앱에서는 반환하지 않습니다. 방금 보호 책을 추가했지만 App Store에 다시 제출해야합니다.

iAP가 앱 스토어 버전에 표시되지 않는 이유를 아는 사람이 있습니까? Apple 서버로 이동하기 위해 "판매 허가"옵션을 기다릴 필요가 있습니까? 감사!

+0

'myProduc'을 기록 했습니까? 앱 구매 식별자를 등록하고 있습니까? – NSAddict

+0

시스템은 시뮬레이터에서 완벽하게 작동하지만 전화에서는 "response.products"배열이 비어있게됩니다. ITC에서 "구매 허가"를 확인하고 사과 서버가이를 인정하기 시작할 때까지 지연이 있습니까? 또한 두 번째 질문에서 무엇을 의미합니까? ITC에서 iAP –

+0

'[[SKProductsRequest alloc] initWithProductIdentifiers : upgradeIdentifiers];에 '승인 됨'이라고 말합니다. '앱내 구매를 바로 등록 했습니까? – NSAddict

답변

0

분명히 myProduct 배열이 비어 있습니다. 왜 이런 일이 발생하는지는 또 다른 질문이지만 요청한 색인이 있는지 확인하지 않고 objectAtIndex으로 전화하지 마십시오.

if ([myProduct count] > 0) 
    noAdProduct = [myProduct objectAtIndex:0]; 
else 
    // Deal with the situation when the array is empty. 
관련 문제