错误:NSURLSession/NSURLConnection HTTP load failed

原因:在 iOS9中,在网络通话中ATS强制采用最佳实践,包括使用HTTPS.

改正:右击 Info.plist 文件 -> Open As > Source Code
然后添加下面代码在最后的之前:

<span class="tag">&lt;key&gt;</span><span class="pln">NSAppTransportSecurity</span><span class="tag">&lt;/key&gt;</span>  
<span class="tag">&lt;dict&gt;</span>  
   <span class="tag">&lt;key&gt;</span><span class="pln">NSAllowsArbitraryLoads</span><span class="tag">&lt;/key&gt;</span>  
   <span class="tag">&lt;true/&gt;</span>  
<span class="tag">&lt;/dict&gt;</span> 

asdf

原文链接:
http://stackoverflow.com/questions/30927368/nsurlsession-nsurlconnection-http-load-failed-kcfstreamerrordomainssl-9802

修改Info.plist之后即可浏览,如下图:

未标题-1

返回顶部