1、使用HTTP请求
iOS9引入了新特性App Transport Security (ATS),新特性要求App内访问的网络必须使用HTTPS协议。
使用HTTP请求需要在info.plist中添加一项内容:
- 在Info.plist中添加NSAppTransportSecurity类型Dictionary。
- 在NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES。
iOS9引入了新特性App Transport Security (ATS),新特性要求App内访问的网络必须使用HTTPS协议。
使用HTTP请求需要在info.plist中添加一项内容:
本文标题:iOS网络方面问题汇总
本文链接:https://www.haomeiwen.com/subject/rwjlmxtx.html
网友评论