2012-01-16 157 views
3

後如何停止uiactivityindicator我想到這些人會做,沒有人越來越稱爲-_-等待應用程序內購買商店加載

- (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; 

謝謝!!!

回答

1

可以隱藏在微調以下方法 -

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

它應該是好的。你應該隱藏3例的微調: - SKPaymentTransactionStatePurchased - SKPaymentTransactionStateFailed - SKPaymentTransactionStateRestored

你檢查你的代表? 你的類應該實現的委託方法:
- > SKPaymentTransactionObserver

煤礦聲明那樣: @interface InAppPurchaseStoreManager:NSObject的

+0

SKPaymentTransactionStatePurchased和SKPaymentTransactionStateFailed適用於用戶購買產品或按下取消的權利?我想隱藏uiiactivityindicator,當蘋果在應用程序購買警報視圖第一次出現時,現在我的微調器在警報視圖後面可見。 -謝謝您的幫助!! – rowdyruckus 2012-01-17 03:29:59

+0

你對代表Diwann說得對,謝謝!另外我還在早些時候加載商店,認爲這會加快速度。在需要時加載,然後在收到產品時似乎是停止微調的好地方。 – rowdyruckus 2012-01-17 03:56:09

相關問題