I was using the following function to make multiple audio players ready.
But when run the code at new iOS Versions I am getting Thread 1: EXC_BAD_ACCESS (code=1, address=0x48) from line players[i] = player
It still runs at old iOS versions without a problem.
func loadMusicToAPlayer(i: Int, name: String){
let s = Bundle.main.path(forResource: name, ofType:nil)!
let url = URL(fileURLWithPath: s )
do {
let player = try AVAudioPlayer(contentsOf: url)
players[i] = player
players[i].prepareToPlay()
players[i].isMeteringEnabled = true
} catch {
print("couldn't load music file :( ")
}
}