I ran into this as well, and the fix above did work. I had it on iOS (as well as Android), but debugged in IOS. The problem was that in a call back I removed two observers, which was ok, but when the ‘post notification’ loop continued, the observers was 2 less than before (59 to 57), so once it hit object #59, it got a bad EXEC as that had been removed from the array. The root cause is simply we’re removing objects in the array while it’s still being looped through, it doesn’t make sense to break the loop at the match because it’s very likely you’ll have multiple listeners for the same notification. So the fix above looks good, but maybe the snippet below can help reproduce for the leads.
Here’s something to reproduce, (The SFDialog class is a popup dialog with a CCMenu, and all it does is send a notification when the button is pressed (in this case kSFDialogCancelButton).
SFDialog *db = SFDialog::dialogWithTitle("Play Again?", "Would you like to start another game?", "Cancel", "New Game");
this->addChild(db, 1000, kDialogTag);
void MainGame::SFDialogCallback(CCObject *obj)