MadProfit
MadProfit

Reputation: 1174

SDK StoreKit Warning

I am getting down to the last programming on my little app and I am using the standard StoreKit code as follows:

- (void) paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions {
for (SKPaymentTransaction *transaction in transactions)
{   
    switch ( transaction.transactionState ) 
    {
       case SKPaymentTransactionStatePurchased: 
           [ self completeTransaction: transaction ];               
        break;
       case SKPaymentTransactionStateFailed:   
           [ self failedTransaction: transaction ];
            break;
       case SKPaymentTransactionStateRestored:  
          [ self restoreTransaction: transaction ];
            break;
       default:                 
            break;
       }    
    }
}

I am getting a MyStoreObserver may not respond to completeTransaction, failedTransaction or restoreTransaction. BTW, I have set up the MyStoreObserver as both h and m files.

The program works fine and StoreKit works fine. I am just trying to figure out what may be causing this warning so I can something to my code to make it go away.

Any ideas?

Upvotes: 0

Views: 830

Answers (2)

MadProfit
MadProfit

Reputation: 1174

Thank you Vlad and Eiko...

For the newbies, here is my code that got rid of the warning in my MyStoreObserver h file..

@interface MyStoreObserver : NSObject <SKPaymentTransactionObserver>

{   
}

- (void) completeTransaction:(SKPaymentTransaction *)transaction;
- (void) failedTransaction:  (SKPaymentTransaction *)transaction;
- (void) restoreTransaction: (SKPaymentTransaction *)transaction;

@end

Also, this code is used with the code contained in "In App Purchase Programming Guide".

Upvotes: 0

Eiko
Eiko

Reputation: 25632

Declare those methods in your .h file, or in a private category in your .m file, so that the compiler knows about them. Or move them up in your .m file so that they appear before calling them.

Upvotes: 1

Related Questions