当应用内购买 UIAlertView 显示时如何隐藏我的等待屏幕?
我添加了一个 UIAlertView,其中 UIActivityIndicatior 作为我的应用程序的子视图。此警报视图仅在购买正在进行时显示。当应用内购买 UIAlertView 显示时如何隐藏我的等待屏幕?
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
for (SKPaymentTransaction *transaction in transactions)
{
switch (transaction.transactionState)
{
case SKPaymentTransactionStatePurchasing:
[self stillPurchasing]; // this show a waiting screen
break;
case SKPaymentTransactionStatePurchased:
NSLog(@"2");
[self completeTransaction:transaction];
break;
case SKPaymentTransactionStateFailed:
[self failedTransaction:transaction];
break;
case SKPaymentTransactionStateRestored:
NSLog(@"4");
[self restoreTransaction:transaction];
break;
default:
NSLog(@"5");
break;
}
}
}
谢谢。
I've added an UIAlertView that has UIActivityIndicatior as a subview on my application. This alertView only show when the purchase is in progress. How to hide my waiting screen when In app purchase UIAlertView is show?
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
for (SKPaymentTransaction *transaction in transactions)
{
switch (transaction.transactionState)
{
case SKPaymentTransactionStatePurchasing:
[self stillPurchasing]; // this show a waiting screen
break;
case SKPaymentTransactionStatePurchased:
NSLog(@"2");
[self completeTransaction:transaction];
break;
case SKPaymentTransactionStateFailed:
[self failedTransaction:transaction];
break;
case SKPaymentTransactionStateRestored:
NSLog(@"4");
[self restoreTransaction:transaction];
break;
default:
NSLog(@"5");
break;
}
}
}
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您保留它直到购买操作完全完成,它将更有用.. 这意味着在情况 1 (SKPaymentTransactionStatePurchased) 中您隐藏指示符,也不要忘记隐藏它,以防购买失败。
it will be more useful if you keep it until the purchase operation is fully completed .. thats mean in case 1 (SKPaymentTransactionStatePurchased) you hide the indicatore ,, also dont forget to hide it in case the purchase failed.