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)
新特性要求App內(nèi)訪問(wèn)的網(wǎng)絡(luò)必須使用HTTPS協(xié)議。
但是現(xiàn)在公司的項(xiàng)目使用的是HTTP協(xié)議,使用私有加密方式保證數(shù)據(jù)安全。現(xiàn)在也不能馬上改成HTTPS協(xié)議傳輸。
最終找到以下解決辦法:
在Info.plist中添加NSAppTransportSecurity類型Dictionary。
在NSAppTransportSecurity下添加NSAllowsArbitraryLoads類型Boolean,值設(shè)為YES