iOS WebView加载URL 报错:Code=-1022

Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loaded because the App Transport Security policy requires the use of a secure connection."安全

这是由于Xcode 7之后,苹果要求全部的网络请求都是安全的(HTTPS).全部若是自己的服务器不支持HTTPS请求的话就要修改Xcode的默认配置.服务器

在info.plist文件中,添加类型为Dictionary的NSAppTransportSecurity,在NSAppTransportSecurity下添加Boolean类型的NSAllowsArbitraryLoads,值设为YES网络

相关文章
相关标签/搜索