InApp 구매 제품의 제품 정보로 사용자 인터페이스를 업데이트하는 데 이상한 문제가 있습니다.InApp Purchase products 사용자 인터페이스 업데이트시 요청 문제
제품 정보를 검색하는 데 다음 코드가 있습니다. 내 문제는 내 레이블을 업데이트하지 않거나 "_buyButton"을 사용할 수 있지만 NSLog를 사용할 때 올바른 값을 볼 수 있습니다. 그리고 예, 저는 IB 매장을 연결했습니다. viewDidLoad 메서드에서 인터페이스 개체를 변경/업데이트 할 수 있습니다. 실제 기기에서 앱을 실행하고 있습니다.
무엇이 누락 되었습니까?
-(void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{
NSArray *products = response.products;
if (products.count != 0)
{
_product = products[0];
_buyButton.enabled = YES;
_productTitle.text = _product.localizedTitle;
_productDescription.text = _product.localizedDescription;
NSLog(@"productsRequest %@", _product.localizedTitle);
} else {
_productTitle.text = @"Product not found";
}
products = response.invalidProductIdentifiers;
for (SKProduct *product in products)
{
NSLog(@"Product not found: %@", product);
}
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
나는 "구매 행동"을 수행 할 수 없다는 것을 깨달았습니다.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid product identifier: (null)'
분명히 할 수 있습니다 :'productsRequest :'을 디버그 출력에 얻을 수 있습니까? –
네,보아야 할 것이 보입니다.하지만 위의 몇 줄은이 값을 UILabel로 설정할 수 없습니다. – Jan
은 [user3104325] (http://stackoverflow.com/users/3104325/user3104325)와 같은 사람입니까? 이것은 이전에 질문 한 것과 매우 유사한 질문입니다. –