-今天早上更新到了Xcode7, 使用網絡請求數據的時候,報錯:
App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.
-緣由是:在iOS9中,蘋果將原http協議改爲了https協議,使用 TLS1.2 SSL加密請求數據。
-解決方案:網絡
在info.plist 加入key <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
-如圖所示
app