iOS 终端请求服务端数据时,
数据请求失败,出现这种错误,该怎么解决呢   急!!!!
Error Domain=ASIHTTPRequestErrorDomain Code=1 "A connection failure occurred" UserInfo=0x8de87c0 {NSUnderlyingError=0x8deec80 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1005.)", NSLocalizedDescription=A connection failure occurred}那么该如何解决该问题呢?经过查找解决方案如下:

解决方案 »

  1.   

    http://stackoverflow.com/questions/6082471/ios-development-why-do-i-always-get-the-a-connection-failure-occurred-on-the这是ASIHttpRequest库的自身的一个问题,并不是你的代码问题。
    问题出在并发性上,自动请求与主动请求冲突,导致返回值为nil。解决看上面的博客吧,就是关闭ASIHttpRequest的持久连接。
      

  2.   

    用的是最新的ASIHttpRequest吗?
      

  3.   


    A fix is to set persistentConnection to NO with your post requests like the following:ASIHTTPRequest *req = [ASIHTTPRequest requestWithURL:url];
    req.shouldAttemptPersistentConnection   = NO;
      

  4.   

    我的是因为scheme选错了出现的这个问题。
    应该用debug,不小心选成了distribute的scheme.
    并发症是,许多变量明明有值(LOG打印也有值),但窗体就是显示nil。