NSURLConnection完成并出现错误-代码-1002修复不起作用 [英] NSURLConnection finished with error - code -1002 fix does not work

查看:84
本文介绍了NSURLConnection完成并出现错误-代码-1002修复不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此错误NSURLConnection并显示错误-代码-1002.我已将以下代码添加到我的info.plist中.有人知道为什么吗?

I am getting this error NSURLConnection finished with error - code -1002. I have added the code below into my info.plist. Does anyone know why?

预先感谢

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
    <key>NSExceptionMinimumTLSVersion</key>
    <string>TLSv1.0</string>
</dict>

推荐答案

我认为这与应用传输安全有关.因为您的网址不是https.请尝试在info.plist文件中进行此类更改

I think it is about App Transport Security.Because your url is not https.Try to change like this in the info.plist file

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

您可以检查所有错误代码以及以下链接上的含义

You can check all error codes and there meanings on following link

NSHipster的NSError

这篇关于NSURLConnection完成并出现错误-代码-1002修复不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆