最近新建APP的時候請求網(wǎng)絡(luò)的時候報錯,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,值設(shè)為YES
如圖
