App Transport Security has blocked a cleartext HTTP问题的解决

前言

由于IOS9用https全面替代http,如果一个工程有涉及http协议的代码,在使用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.

解决方式:

找到工程的info.plist,如下图所示操作

App Transport Security has blocked a cleartext HTTP问题的解决_第1张图片
屏幕快照 2015-10-14 下午5.26.12.png

添加如下代码:
NSAppTransportSecurity

NSAllowsArbitraryLoads

App Transport Security has blocked a cleartext HTTP问题的解决_第2张图片
屏幕快照 2015-10-14 下午5.27.43.png

完美解决。

你可能感兴趣的:(App Transport Security has blocked a cleartext HTTP问题的解决)