原因:iOS9以后,苹果把原http协议改成了https协议,所以不能直接在http协议下GET/POST

解决方案之一:

直接编辑工程文件下的Info.plist文件,加入以下代码

  <key>NSAppTransportSecurity</key>
  <dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
  </dict>

如图所示:

解决方案之二:

a.在Xcode里选中info.plist,点击右边的information Property List 后边的加号

b.写入App Transport Security Settings然后回车,先点击左侧展开箭头,再点右侧加号,Allow Arbitrary Loads 已经自动生成,直接回车。

c.需要把默认的值改成YES

其实效果是一样的,打开info.plist文件,发现方案一中的文字已经自动添加

<完>

 
 http://www.cnblogs.com/36bian/p/5237138.html

AFNetworking 提示"The resource could not be loaded because the App Transport Security policy requires the use of a secure connection" 解决办法的更多相关文章

  1. Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

    Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport Xcode7 beta 网络请求报错:The ...

  2. The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.问题解决

    didFailLoadWithError(): Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loa ...

  3. 网络请求报错:The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

    iOS9引入了新特性App Transport Security (ATS).详情:App Transport Security (ATS) 如果你想设置不阻止任何网络,只需要在info.plist文 ...

  4. The resource could not be loaded because the App Transport Security policy requires the use of a secure connection

    xmpp 项目中遇到的问题,用苹果的通信API 写一个PUT 方法,向服务器上传一张图片.遇到如题问题. Plist 文件没有NSAppTransportSecurity属性 Dic,添加该属性,再添 ...

  5. xcode9.4 报错 error:The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

    原因 http | https 协议  不能正常使用 找到的解决方案 但是在字段名上有了变化,不过复制进去 还是会自动选择对应的 解决办法 1. 在Info.plist中添加 App Transpor ...

  6. IOS9网络请求报错:The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

    今天下载Xcode7试了下,运行项目时报上面的错误,网上查了下原来iOS9引入了新特性App Transport Security (ATS).详情:App Transport Security (A ...

  7. Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport Security policy requir

          今天升级Xcode 7.0 bata发现网络访问失败.输出错误信息 The resource could not be loaded because the App Transport S ...

  8. The resource could not be loaded because the App Transport

    Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport Xcode7 beta 网络请求报错:The ...

  9. Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport

    Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport Xcode7 beta 网络请求报错:The ...

随机推荐

  1. iOS 获取当前用户的用户路径并写入文件

    NSString *path = [[@"~" stringByExpandingTildeInPath] stringByAppendingString: @"/tmp ...

  2. qq邮箱邮我组件

    http://openmail.qq.com/cgi-bin/qm_help_mailme?sid=uvkgSu7e0aOrc0Qc&t=open_mailme 邮我 使用"邮我&q ...

  3. aspx与ashx

    ashx在VS的中文版是新建“一般处理程序”,其实是一个实现类System.Web.IHttpHandler接口的类.而任何一个实现了IHttpHandler接口的类都能作为一个外部请求的目标程序.H ...

  4. 【HDU】4035 Maze

    http://acm.hdu.edu.cn/showproblem.php?pid=4035 题意:给一棵n个节点的树,每个节点有值k[i]和e[i],分别表示k[i]概率走向1号节点,e[i]概率获 ...

  5. 【hdu】p1754I Hate It

    I Hate It Time Limit: 9000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total S ...

  6. Find和FirstOrDefault()有什么区别?

    Find方法和FirstOrDefault方法效果相同,都是返回满足条件的第一个元素,如果没有该元素,则返回null. 那么这两个扩展方法有什么不同? 1)Find方法是.netFramework2. ...

  7. SDL 五子棋游戏

    http://www.jb51.net/article/79271.htm 1.定义窗口大小,棋盘大小 SDL_GetWindowSize()读取窗口大小, 由于棋盘是15*15格局,上下留白一行,在 ...

  8. iOS模拟器多个虚拟机怎么处理

    1:关闭Xcode和模拟器 2:$sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService 等待输入密码 3:$rm -f ~/Libr ...

  9. FPGA技术的发展历史和动向

    本文关键字:fpga技术,fpga发展, fpga培训,FPGA应用开发入门与典型实例 一.FPGA技术的发展历史 纵观数字集成电路的发展历史,经历了从电子管.晶体管.小规模集成电路到大规模以及超大规 ...

  10. 查看linux中某个端口(port)是否被占用(netstat,lsof)

    查看linux中某个端口(port)是否被占用(netstat,lsof) netstat命令可以显示网络连接,路由表,接口状态,伪装连接,网络链路信息和组播成员组等信息.命令格式:netstat [ ...