我根据应用程序内购买编程指南使用以下代码来请求产品列表.它曾经在我的iPhone应用程序中正常工作,但现在每次请求产品列表时它都会崩溃.(void)productsRequest:(SKProductsRequest **)request didReceiveResponse:(SKProductsResponse **)response永远不会调用委托方法.
SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithObject:@"my.product.identifier"]];
[request setDelegate:self];
[request start];
Run Code Online (Sandbox Code Playgroud)
正如我所说,它工作得非常好,然后停止工作.这是在调用上面的代码时发生的崩溃.
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000011
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x000034f8 objc_msgSend + 24
1 StoreKit 0x00003e18 -[SKProductsRequest handleFinishResponse:returningError:] + 40
2 StoreKit 0x000050c4 -[SKRequest _requestFinishedNotification:] + 152
3 Foundation 0x00019b9a _nsnote_callback + 150
4 CoreFoundation 0x0006c2de __CFXNotificationPost_old + 390
5 CoreFoundation 0x0001ab32 _CFXNotificationPostNotification + 122
6 Foundation 0x000048e4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 64
7 AppSupport …Run Code Online (Sandbox Code Playgroud)