ios - NSNotificationCenter sending deallocated message during app purchase -


I know that this question has been asked many times, but I still have problems with it. I have some non-consumable app purchase codes that work fine if the user stays in the scene and buys them all at once. However, if the user leaves this menu and returns to it, the code will crash when he completes the transaction. I am using cocos2d for this. Provide MKStoremanager.m

  - (zero) to 

Resource: (NSString *) Product Identifier {NSLOG (@ "ProductInfifier =% @ ", Product identifier); NC = [NSNetification Center's default center]; Convenience = bought; [Nc postnotification name: @ "feature acquired" object: zero]; // & lt; - Crashes here [MKStoreManager updatePurchases]; MSStoreObverser.m

  - (zero) full transaction: (SKPaymentTransaction *) transaction {NSLog (@ " Full transaction "); NSLog (@ "transaction.payment.productIdentifier =% @", transaction.payment.productIdentifier); // [[NSNotificationCenter defaultCenter] to remove observer: self]; // & lt; - Attempts to remove supervisor still crash [[SKPMentQueue default QE] filtranspace: transaction]; [[MKStore Manager Shared Manager]] Communication: transaction.payment.productIdentifier]; } - (zero) Payment Quote: (SKPMntQ *) Queue Update Transaction: (NSARRA *) Transactions {NSLog (@ "Payment Qi"); (SKPMant Transactions * Transactions in Transaction) {Switch (Transaction Transaction State) (Case Skpiment Transaction: Buying Static: [Self Full Transactions: Transactions]; // & lt; - Here breaks NSG (@ "Purchase was success- J"); break; Case SkpMent Transaction: Static File: [Self-Failed Transaction: Transaction]; break; Case SCCMant Transaction Status Reinstated: [Self Restored Transactions: Transactions]; break; Default: Break; I think the issue is that the NSNotificationCenter supervisor is not removing properly, but I'm not sure why   

< According to my comment, we need to remove the supervisor because to ensure that we are not sending messages for the dispatching items. - (Zero) Remove Delok [[NSNation Centers Defensive Centers]: Observer: Self]; }


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -