在iOS 9(xcode7)環境下作網絡圖片下載的請求(http //:),出現如下的問題xcode
The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.安全
緣由:網絡
iOS9引入了新特性App Transport Security (ATS)。詳情:App Transport Security (ATS)ui
新特性要求App內訪問的網絡必須使用HTTPS協議。加密
可是如今公司的項目使用的是HTTP協議,使用私有加密方式保證數據安全。如今也不能立刻改爲HTTPS協議傳輸。spa
解決辦法:code
在Info.plist中添加NSAppTransportSecurity
類型Dictionary
。圖片
在NSAppTransportSecurity
下添加NSAllowsArbitraryLoads
類型Boolean
,值設爲YES
it