After updating to Xcode 11.1, the music playback function stopped working. Application stops with error Thread 1: EXC_BAD_ACCESS (code=1, address=0x48)
This is my function that played music and in xcode 10 it works:
func playBackgroundMusic(file: String) {
do {
backgroundMusic = try AVAudioPlayer(contentsOf: Bundle.main.url(forResource: file, withExtension: "mp3")!)
backgroundMusic.numberOfLoops = -1
backgroundMusic.play()
} catch {
print("Can't play music")
}
}
maybe someone faced such a problem? I'm tried change mp3 file, but it not helped.