最近新建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
如图












网友评论