升級Xcode 7.0
發現網絡訪問失敗。
輸出錯誤信息html
The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.
Google後查證,iOS9引入了新特性App Transport Security (ATS)
。詳情:App Transport Security (ATS)ios
新特性要求App內訪問的網絡必須使用HTTPS
協議。
可是如今公司的項目使用的是HTTP
協議,使用私有加密方式保證數據安全。如今也不能立刻改爲HTTPS
協議傳輸。安全
在Info.plist中添加NSAppTransportSecurity
類型Dictionary
。網絡
在NSAppTransportSecurity
下添加NSAllowsArbitraryLoads
類型Boolean
,值設爲YES
app
其餘問題參考: http://blog.csdn.net/hongfengkt/article/details/48543091ui