最近使用到Http进行网络访问的时候,遇到的一个问题。
the resource could not be loaded because the app transport security policy requires the use of a secure connection
解决方案:
1. 在项目的Info.plist,文件中添加添加NSAppTransportSecurity类型为Dictionary
2. 在NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean —- >为: YES
我这边通过这个方案解决了问题,毕竟Xcode的操作还不是很熟悉。