I'm testing my app on device (a soundboard) and it crashes with a EXC_BAD_ACCESS, I have use Breakpoints and the error came from [AVAudioSession privateBeginInterruption]
The crash happens following this pattern:
[self.navigationController popViewControllerAnimated:YES];)I have no idea what is happening here, I have installed CrashLytics and it only said:
Maybe the audio session gets released from memory and the app tries to access to it and fail?
The audio session is initialised in viewDidLoad
// Initialize audio session
[[AVAudioSession sharedInstance] setDelegate: self];
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error: nil];
UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker;
AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute,sizeof (audioRouteOverride),&audioRouteOverride);
In viewDidUnload I have
[[AVAudioSession sharedInstance] setDelegate: nil];
Any hints?
Thanks!
The crash happens because you had set the delegate of session to your controller in this line
[[AVAudioSession sharedInstance] setDelegate: self];
but didn't implemented the required delegate method (interruption one)
either remove the delegate setting line or implement the delegate method to solve crash
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With