-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最新的一个 –