如何在等待应用程序内购买商店加载后停止uiactivityindicator

时间:2012-01-16 22:15:49

标签: iphone ios xcode in-app-purchase uiactivityindicatorview

我认为其中一个会这样做,没有一个被称为-_-

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
    NSLog(@"flag paymentQueue");

// spinner.hidden = YES; //这是哪里的?

    for (SKPaymentTransaction *transaction in transactions)
    {
        switch (transaction.transactionState)
        {
            case SKPaymentTransactionStatePurchasing:
            //    [self stillPurchasing]; // this creates an alertView and shows
                NSLog(@"flag SKPaymentTransactionStatePurchasing");

                break;
            case SKPaymentTransactionStatePurchased:
                NSLog(@"flag SKPaymentTransactionStatePurchased");

                [self completeTransaction:transaction];
                break;
            case SKPaymentTransactionStateFailed:
                NSLog(@"flag SKPaymentTransactionStateFailed");

                [self failedTransaction:transaction];
                break;
            case SKPaymentTransactionStateRestored:
                NSLog(@"flag SKPaymentTransactionStateRestored");

                [self restoreTransaction:transaction];
           //     spinner.hidden=YES;
                break;

感谢!!!

2 个答案:

答案 0 :(得分:1)

它应该是好的。在3种情况下你应该隐藏你的微调器: - SKPaymentTransactionStatePurchased - SKPaymentTransactionStateFailed - SKPaymentTransactionStateRestored

你检查过你的代表吗? 你的类应该实现委托方法:
- > SKPaymentTransactionObserver

我的声明如下:     @interface InAppPurchaseStoreManager:NSObject

答案 1 :(得分:1)

您可以使用以下方法隐藏微调器 -

    - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {
      [target hideSpinner];
     }