It crashed on Cocos2d version 3.16. To reproduce the problem:
- Run the cocos2d game
- Make a phone call to the phone that running the game
- It crashed and show [CDAudioManager handleInterruption]: unrecognized selector sent.
To fix the problem, change the following code in CDAudioManager.m
From:
[[NSNotificationCenter defaultCenter] addObserver: self
selector: NSSelectorFromString(@“handleInterruption”)
name: AVAudioSessionInterruptionNotification
object: [AVAudioSession sharedInstance]];
To:
[[NSNotificationCenter defaultCenter] addObserver: self
selector:@selector(handleInterruption:)
name: AVAudioSessionInterruptionNotification
object: [AVAudioSession sharedInstance]];