because the App Transport Security policy requires the use of a secure connection.

最近新建APP的时候请求网络的时候报错,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

如图

你可能感兴趣的:(because the App Transport Security policy requires the use of a secure connection.)