因为在加载失败的代理方法里面会让WK加载 本地的一个html,没想到WK在加载本地的页面也有失败的时候,然后造成无限加载的死循环。
现在处理的方式 是,加一个变量errLoadCount > 20 次,调用goBack,返回到上一级页面。 记得return 哦,不能再加载本地的html了。
function:-[BaseWebView webView:didFailProvisionalNavigation:withError:] line:60 content:error = Error Domain=NSURLErrorDomain Code=-999 "(null)" UserInfo={NSErrorFailingURLStringKey=file:///var/containers/Bundle/Application/2433D7BC-717A-470C-8DDE-A2430E3A1F45/WebView.app/error/index.html, NSErrorFailingURLKey=file:///var/containers/Bundle/Application/2433D7BC-717A-470C-8DDE-A2430E3A1F45/WebView.app/error/index.html, _WKRecoveryAttempterErrorKey=<WKReloadFrameErrorRecoveryAttempter: 0x1c0429f00>}
function:-[BaseWebView webView:didFailProvisionalNavigation:withError:] line:53 content:
function:-[BaseWebView webView:didFailProvisionalNavigation:withError:] line:60 content:error = Error Domain=NSURLErrorDomain Code=-999 "(null)" UserInfo={NSErrorFailingURLStringKey=file:///var/containers/Bundle/Application/2433D7BC-717A-470C-8DDE-A2430E3A1F45/WebView.app/error/index.html, NSErrorFailingURLKey=file:///var/containers/Bundle/Application/2433D7BC-717A-470C-8DDE-A2430E3A1F45/WebView.app/error/index.html, _WKRecoveryAttempterErrorKey=<WKReloadFrameErrorRecoveryAttempter: 0x1c0436140>}
function:-[BaseWebView webView:didFailProvisionalNavigation:withError:] line:53 content:
function:-[BaseWebView webView:didFailProvisionalNavigation:withError:] line:60 content:error = Error Domain=NSURLErrorDomain Code=-999 "(null)" UserInfo={NSErrorFailingURLStringKey=file:///var/containers/Bundle/Application/2433D7BC-717A-470C-8DDE-A2430E3A1F45/WebView.app/error/index.html, NSErrorFailingURLKey=file:///var/containers/Bundle/Application/2433D7BC-717A-470C-8DDE-A2430E3A1F45/WebView.app/error/index.html, _WKRecoveryAttempterErrorKey=<WKReloadFrameErrorRecoveryAttempter: 0x1c0428980>}
function:-[BaseWebView webView:didFailProvisionalNavigation:withError:] line:53 content:
function:-[BaseWebView webView:didFailProvisionalNavigation:withError:] line:60 content:error = Error Domain=NSURLErrorDomain Code=-999 "(null)" UserInfo={NSErrorFailingURLStringKey=file:///var/containers/Bundle/Application/2433D7BC-717A-470C-8DDE-A2430E3A1F45/WebView.app/error/index.html, NSErrorFailingURLKey=file:///var/containers/Bundle/Application/2433D7BC-717A-470C-8DDE-A2430E3A1F45/WebView.app/error/index.html, _WKRecoveryAttempterErrorKey=<WKReloadFrameErrorRecoveryAttempter: 0x1c4433700>}
function:-[BaseWebView webView:didFailProvisionalNavigation:withError:] line:53 content:
function:-[BaseWebView webView:didFailProvisionalNavigation:withError:] line:60 content:error = Error Domain=NSURLErrorDomain Code=-999 "(null)" UserInfo={NSErrorFailingURLStringKey=file:///var/containers/Bundle/Application/2433D7BC-717A-470C-8DDE-A2430E3A1F45/WebView.app/error/index.html, NSErrorFailingURLKey=file:///var/containers/Bundle/Application/2433D7BC-717A-470C-8DDE-A2430E3A1F45/WebView.app/error/index.html, _WKRecoveryAttempterErrorKey=<WKReloadFrameErrorRecoveryAttempter: 0x1c0436140>}