/var/mobile/Containers/Data/Application/0D091A98-C68A-4A76-BB8B-CD16DA2B472F/Documents/iTestWav/File/itest_web/dist/index.html
webView.loadFileURL(requestURL, allowingReadAccessTo: accessURL)访问本地网页报错:Could not create a sandbox extension
原因如下:
var documentDirectoryPath:String? = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first
documentDirectoryPath这个是绝对路径,不能把绝对路径保存到Defaults或者数据库中进行重新访问,因为更新版本,绝对路径有变动;

本文探讨了在iOS应用中使用WebView加载本地HTML文件时遇到的Could not create a sandbox extension错误。详细分析了问题原因,即由于更新版本导致的绝对路径变动,无法通过Defaults或数据库重新访问。
2039

被折叠的 条评论
为什么被折叠?



