objective c - app crashes first time only not in second time in app purchase ios -


my app crashes first time when buying in app purchase when app run second time not crashing. getting:

exc_bad_access(code=1, address=0x11f3)

i have searched not getting solution this. have used following dealloc method :-

-(void)dealloc  {      sharedinstance.productsrequest.delegate = nil;     sharedinstance.productsrequest = nil;      [[skpaymentqueue defaultqueue] removetransactionobserver:sharedinstance];  } 

my code getting crash :-

-(void)purchaseitem:(skproduct *)product {       nslog(@";buying %@...", product.productidentifier);      if (product == nil) {         [self noproductsfound];     } else {          skpayment *payment = [skpayment paymentwithproduct:product];        [[skpaymentqueue defaultqueue] addpayment:payment];// here getting crash warning...      } } 

thanks in advance .


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -