美文网首页
Xcode更新7以后http无法正常连接

Xcode更新7以后http无法正常连接

作者: 云溪_Cloud | 来源:发表于2015-11-23 16:21 被阅读37次

    在使用Xcode 7 写代码,发送网路请求时会报错: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

    这是因为新特性要求的app内访问网络请求,要采用HTTPS协议提高安全性。但是以前的项目都使用的是HTTP协议,无法改成HTTPS可采用以下方法

    1.在Info.plist中添加 NSAppTransportSecurity 类型 Dictionary 。

    2.在 NSAppTransportSecurity 下添加 NSAllowsArbitraryLoads 类型Boolean ,值设为 YES

    相关文章

      网友评论

          本文标题:Xcode更新7以后http无法正常连接

          本文链接:https://www.haomeiwen.com/subject/nesrhttx.html