Error Domain=kCFErrorDomainCFNet
2018-04-08 本文已影响23人
倪大头
网络请求返回error,code = -1022
原因是iOS9以后,需要App的网络协议必须使用HTTPS协议
在工程的plist文件中,新增一个属性
1.字典 NSAppTransportSecurity
2.在NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES

网络请求返回error,code = -1022
原因是iOS9以后,需要App的网络协议必须使用HTTPS协议
在工程的plist文件中,新增一个属性
1.字典 NSAppTransportSecurity
2.在NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES