采用webView控件加载网络资源异常处理

由于webView默认加载https协议的网络资源,所以采用http协议的文件需要做相关配置,否则,会出现以下异常
运行时发生以下异常信息:

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app’s Info.plist file.

发生以下异常后,导致加载失败:
解决办法:
编译info.plist文件
采用编辑模式,加入以下内容
< key>NSAppTransportSecurity< / key >
< dict >
< key>NSAllowsArbitraryLoads< / key >
< true/ >
< / dict >
如图所示:
info.plist文件设置