不匹配任何可用的重载 (FileURLWithPath)
Do not match any available overloads (FileURLWithPath)
我无法让这段代码工作,我一直收到一条错误消息:
Argument labels '(FileURLWithPath:)' do not match any available
overloads
do {
audioPlayer = try
AVAudioPlayer(contentsOf:
URL(FileURLWithPath: sound!))
audioPlayer.prepareToPlay()
} catch {
print("error")
}
你有什么建议吗?
提到的错误Argument labels '(FileURLWithPath:)' do not match any available overloads
是相当值得注意的。
替换
AVAudioPlayer(contentsOf: URL(FileURLWithPath: sound!))
与
AVAudioPlayer(contentsOf: URL(fileURLWithPath: sound!))
我无法让这段代码工作,我一直收到一条错误消息:
Argument labels '(FileURLWithPath:)' do not match any available overloads
do {
audioPlayer = try
AVAudioPlayer(contentsOf:
URL(FileURLWithPath: sound!))
audioPlayer.prepareToPlay()
} catch {
print("error")
}
你有什么建议吗?
提到的错误Argument labels '(FileURLWithPath:)' do not match any available overloads
是相当值得注意的。
替换
AVAudioPlayer(contentsOf: URL(FileURLWithPath: sound!))
与
AVAudioPlayer(contentsOf: URL(fileURLWithPath: sound!))