I cannot seem to get my UI to update when my object that implements SKPaymentTransactionObserver is called.
Specifically, I have a (UILabel *)debugLabel in my UI (all wired up via IB). I have my implementation of the observer protocol:
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions {
NSLog(@"paymentQueue: current thread is main thread: %@", [[NSThread currentThread] isMainThread]?@"YES":@"NO");
for (SKPaymentTransaction *transaction in transactions) {
if (transaction.transactionState == SKPaymentTransactionStatePurchased) {
// if the store is still being viewed, update appropriately
if(spViewController.storeViewController) {
[spViewController.storeViewController transactionComplete:transaction];
}
}
// other transactionStates omitted for brevity
}
}
The [spViewController.storeViewController transactionComplete:transaction]
is executed, but the UILabel does not display the assigned text.
- (void) transactionComplete:(SKPaymentTransaction *) transaction {
NSLog(@"CBTSVC transactionComplete");
debugLabel.text = @"CBTSVC transactionComplete";
// other UI updates omitted for brevity
}
When the code executes, the NSLog dumps the string to the console, but the UILabel is not updated. I've confirmed that the callbacks made to the SKPaymentTransactionObserver are occuring on the main thread -- so the UI should be updating. (Right?)
What gives? It must be missing something simple?
Thanks for any insights, pointers, etc.