我已经设置了以下两个功能:getDirectory和displayAlert。我确定我没有把它们拼错。但是,为什么仍然存在未解决的标识符?谢谢!
let filename = getDirectory().appendingPathComponent("\(numberOfRecords).m4a")
catch
{
displayAlert(title:"Oops!", message: "Recording failed")
}
func getDirectory() -> URL
{
let paths = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)
let documentDirectory = paths[0]
return documentDirectory
}
func displayAlert(title:String, message:String){
let alert = UIAlertController(title:title, message: message, preferredStyle: .alert)
alert.addAction(UIAlertAction(title:"dismiss", style: .default, handler: nil))
present(alert, animated: true, completion: nil)
}[enter image description here][1]