处理iOS应用程序中的中断

处理iOS应用程序中的中断,ios,iphone,interrupt-handling,Ios,Iphone,Interrupt Handling,我很难处理OpenGL ES 2.0 iOS应用程序中的中断。这确实与OpenAL有关,我想我知道如何处理它,但问题是我的中断处理程序永远不会被调用。我已尝试通过以下方式注册通知: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(interruptionHandler:) name:AVAudioSessionInterruptionNotification object:nil];

我很难处理OpenGL ES 2.0 iOS应用程序中的中断。这确实与OpenAL有关,我想我知道如何处理它,但问题是我的中断处理程序永远不会被调用。我已尝试通过以下方式注册通知:

[[NSNotificationCenter defaultCenter] addObserver:self
  selector:@selector(interruptionHandler:)
  name:AVAudioSessionInterruptionNotification
  object:nil];
在其他方法中(
AVAudioPlayerDelegates
等)

在iOS模拟器上,如果用户向下滑动以打开通知中心,或向上滑动以打开控制中心,然后返回应用程序,则需要重置OpenAL代码,因为它停止工作。但是,我如何捕捉这两个中断呢?

我不知道。:)但是我做了一次搜索,显然你不是唯一一个有这个问题的人。