更新时间:2022-04-12 22:11:26
任何遇到此线程的人,@ LeoDabus都向我指出了在哪里关闭沙箱的方法,
Anyone coming across this thread, @LeoDabus pointed me to where to turn off sandbox, which worked:
他还整理了一下我的代码:
He also cleaned up my code a bit:
let fileURL = URL( fileURLWithPath: "/Users/me/file.txt" )
var rawDataString: String
var errorString: String?
do {
rawDataString = try String( contentsOf: fileURL, encoding: .utf8 )
} catch let error as NSError {
errorString = error.description
rawDataString = ""
return
}