Ios 音频在后台执行

Ios 音频在后台执行,ios,iphone,audio,background,ezaudio,Ios,Iphone,Audio,Background,Ezaudio,我试过了 __block UIBackgroundTaskIdentifier task=0; task=[application beginBackgroundTaskWithExpirationHandler:^{ NSLog(@"Expiration handler called %f",[application backgroundTimeRemaining]); [application endBackgroundTask:task]; task=UIBackg

我试过了

__block UIBackgroundTaskIdentifier task=0;
task=[application beginBackgroundTaskWithExpirationHandler:^{
    NSLog(@"Expiration handler called %f",[application backgroundTimeRemaining]);
    [application endBackgroundTask:task];
    task=UIBackgroundTaskInvalid;
}];
我想在录制音频时显示波形。我使用了
EZAudio
类,但当我按下HOME按钮或锁定屏幕时,它会崩溃。
如何在后台运行应用程序请帮助我。

我刚刚使用了
EZAudioPlot
更改为
EZAudioPlotGL
。 选择
EZAudioPlotGL
view仅更改视图的类名转到identity inspector并将其更改
EZAudioPlot
。之后

@property (nonatomic,weak) IBOutlet EZAudioPlotGL *audioPlot;
改变它

@property (nonatomic,weak) IBOutlet EZAudioPlot *audioPlot;
它的工作很好