-1
我的音樂播放器代碼的第一行出現錯誤。我該如何解決它?音樂播放器錯誤
Error: Call can throw but its not marked with try and the error is not handled
audioPlayer = AVAudioPlayer(contentsOf: pianoSound as URL)
audioPlayer.prepareToPlay()
var pianoSound = NSURL(fileURLWithPath: Bundle.main.path(forResource: "C", ofType: "m4a")!)
var audioPlayer = AVAudioPlayer()
這給我錯誤的第二行代碼 –
什麼是錯誤?什麼版本的Xcode? –
我得到Xcode 8最新的一個 –