1005 code ios_ios code=-1005 - CSDN
精华内容
参与话题
  • wifi情况下,在iOS 10上大概率的出现code = -1005,但在iOS 9,iOS 8,iOS 7上都没有问题。而且移动网络下也没有这个问题。通过谷歌,在苹果论坛中找到了相同情况的帖子。当时还以为是苹果的bug。但通过测试许多大厂...

    wifi情况下,在iOS 10上大概率的出现code = -1005,但在iOS 9,iOS 8,iOS 7上都没有问题。而且移动网络下也没有这个问题。

    通过谷歌,在苹果论坛中找到了相同情况的帖子。当时还以为是苹果的bug。但通过测试许多大厂的App都没有此问题,而且Android也没有问题,所以就怀疑是iOS App端问题。

    于是就想自己写一个简单的测试网络服务,只返回和当前App上相同数据量的json数据,从而来做测试。通过该测试并没有出现该问题,一切运行良好。感觉可能是服务端的问题。

    通过搜索,找到了一个在stackoverflow上的帖子。但该帖子说的是在iOS 8下的情况,抱着试一试的心态。让服务端按着方案一来设置服务端。因为服务端跳转比较多,经过各个跳转服务端的设置测试。最终确定在App直接连接到的服务端上配置就能解决此问题。

    最终的配置如下:
    - 1、需要打开服务端Response Header中的Connection为Keep-alive,
    同时设置(此处打开后,一定要在请求返回的Response中查看。如果没有Connection项,表示默认打开了。或者有Connection = “keep-alive”;这一项,也是打开了)。
    - 2、timeout http-keep-alive 60s

    展开全文
  • 这个错误偶尔会出现 我是用AFNetworking的 是在刷新的时候 基本上iPhone6刷新10次就会报一次这个错误 这是为什么啊
  • 在练习react native时遇到图片显示不了的问题,打印...Problem:I have application which works fine on Xcode6-Beta1 and Xcode6-Beta2 on both iOS7 and iOS8 but, in Xcode6-Beta3, Beta4, Beta5 facing network is

    在练习react native时遇到图片显示不了的问题,打印出来的错误如题,因此找到了解决方法。
    Problem:

    I have application which works fine on Xcode6-Beta1 and Xcode6-Beta2 on both iOS7 and iOS8 but, in Xcode6-Beta3, Beta4, Beta5 facing network issue on iOS8 but works fine on iOS7. I recieve error:

    “The network connection was lost.”.

    The error printed was as follows:

    error: Error Domain=NSURLErrorDomain Code=-1005 “The network connection was lost.” UserInfo=0x7ba8e5b0 {NSErrorFailingURLStringKey=, _kCFStreamErrorCodeKey=57, NSErrorFailingURLKey=, NSLocalizedDescription=The network connection was lost., _kCFStreamErrorDomainKey=1, NSUnderlyingError=0x7a6957e0 “The network connection was lost.”}

    I use AFNetworking 2.x and following code snippet to make network call:

    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    [manager setSecurityPolicy:policy];
    manager.requestSerializer = [AFHTTPRequestSerializer serializer];
    manager.responseSerializer = [AFHTTPResponseSerializer serializer];
    
    [manager POST:<example-url>
       parameters:<parameteres>
          success:^(AFHTTPRequestOperation *operation, id responseObject) {
              NSLog(@“Success: %@", responseObject);
          } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
              NSLog(@"Error: %@", error);
          }];

    I tried with NSURLSession and still I receive the same error.

    Answers:
    Restarting the simulator fixed the issue for me.

    We add this exact error and it turned out to be an issue with the underlying HTTP implementation of NSURLRequest:

    As far as we can tell, when iOS 8 receive an HTTP response with a Keep-Alive header, it keeps this connection to re-use later (as it should), but it keeps it for more than the timeout parameter of the Keep-Alive header and then when a second request comes it tries to re-use a connection that has been dropped by the server.

    As a monkey patch if anybody else is having this issue, you can add BrowserMatch
    “^iOS/8.” nokeepalive (with the correct user agent) somewhere in your Apache server config (This is nowhere near perfect but makes things work until Apple patches iOS8).

    For mine, Resetting content and settings of Simulator works. To reset the simulator follow the steps:

    iOS Simulator -> Reset Content and Settings -> Press Reset (on the warning which will come)

    The iOS 8.0 simulator runtime has a bug whereby if your network configuration changes while the simulated device is booted, higher level APIs (eg: CFNetwork) in the simulated runtime will think that it has lost network connectivity. Currently, the advised workaround is to simply reboot the simulated device when your network configuration changes.

    If you are impacted by this issue, please file additional duplicate radars at http://bugreport.apple.com to get it increased priority.

    If you see this issue without having changed network configurations, then that is not a known bug, and you should definitely file a radar, indicating that the issue is not the known network-configuration-changed bug.

    参考:http://stackoverflow.com/questions/25372318/error-domain-nsurlerrordomain-code-1005-the-network-connection-was-lost

    展开全文
  • 服务器框架采用springMVC,mybatis,spring。浏览器,httpClient,postman测试,都能返回正确数据json...ios客户端调用抛以下异常: 经分析确认,iso10存在漏洞不兼容导致。 解决办法:修改服务端session实现方式
    服务器框架采用springMVC,mybatis,spring。浏览器,httpClient,postman测试,都能返回正确数据json格式。ios客户端调用抛以下异常:


    经分析确认,iso10存在漏洞不兼容导致。
    解决办法:修改服务端session实现方式
    展开全文
  • Simulator -> Reset Content and Settings -> Press Reset (on the warning which will come)

    重置模拟器:

    Simulator -> Reset Content and Settings -> Press Reset 



    展开全文
  • 参考链接:https://stackoverflow.com/questions/25372318/error-domain-nsurlerrordomain-code-1005-the-network-connection-was-lost Java版代码: response.setHeader("Connection", "Keep-Alive"); response.set...
  • iOS官方Sample大全

    万次阅读 2011-11-23 19:55:10
    http://developer.apple.com/library/ios/samplecode/Birthdays/Birthdays.zip  http://developer.apple.com/library/ios/samplecode/ClockControlPalette/ClockControlPalette.zip  ...
  • 升级了Xcode,真机测试会遇到code signing is required for product type 'xxxxx' in SDK 'iOS 10.0' ,具体如下 解决方法稍微做一下设置,clean后运行
  • 今天在运行程序到IOS simulator的时候,报了一个错:  An Error war encountered while running(Domain = FBSOpenApplicationErrorDomain, Code = 4),上网查资料后找到了解决方案,重置一下模拟器就OK了,如下图:...
  • 参考:http://stackoverflow.com/questions/25372318/error-domain-nsurlerrordomain-code-1005-the-network-connection-was-lost
  • iOS code signing identity 配置

    千次阅读 2019-04-20 21:40:17
    PROJECT 和 TARGET 中都要选:code signing identity: 调试统一都选 developer, 发布统一都选 distribution provisioning Profile 也要选. 过期和无效的证书及时删除, 避免 ambiguous 警告. 选择正确的...
  • 在真机测试的时候往往会突然出现这样一个错误,code signing is required for product type 'Application' in SDK 'iOS 7.0' ,就是说代码签名证书不对劲。 解决方案, 1.选择工程->Build Settings -> ...
  • 大家在做真机调试的时候,或许会遇到这样的问题,那如何去解决? 网上有大把的教程,所以具体的我就不说了,说关键点。 当这种情况出现了: 1.看看自己工程里面的xxx-Info.plist文件里面的Bundle identifier是否...
  • iOS 开发 Certificate和Code Signing–证书与签名–详解1.Certificate-证书iOS 开发 证书–根证书/申请证书/开发(发布)证书–详解2.Code Signing-签名 iOS 开发 code sign 代码签名深入剖析每个证书(其实是公钥)...
  • iOS开发者必备:五大编程类工具

    万次阅读 2018-03-28 16:51:24
    iOS10正式版的发布,无疑又掀起一场开发热潮。iOS开发工具多如牛毛,开发者在编写大段代码时,难免会出现结构或语法错误。所以选择一款功能强劲且实用的编程工具对开发者来说可谓是大有裨益。小编收录和整理了对...
  • Error Domain=NSURLErrorDomain Code=-1005 "网络连接已中断。" UserInfo={_kCFStreamErrorCodeKey=57, NSUnderlyingError=0x282019fe0 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(nul...
  • 获取ios设备设置的国家和语言

    千次阅读 2012-05-31 14:08:40
    CCLOG("country code:%s;language code=%s", [RootViewController getCountryCode].UTF8String,[RootViewController getLanguageCode].UTF8String); //US en */ + (NSString *)getCountryCode { retu
  • 真机iPad mini2,iOS9.1,已经在info.plist中增加 ``` <key>NSAppTransportSecurity <key>NSAllowsArbitraryLoads ``` ![显示为这样](https://img-ask.csdn.net/upload/201601/21/1453314365_475992.png) ...
  • JS 和 iOS 交互,加载 webView 时抛出异常, NSURLConnection finished with error - code -1100, 异常原因是由于没有找到文件。 我遇到的原因: 原因1:没有将要加载的文件(如图片等)添加到项目中 原因2:JS ...
  • 问题 Xcode运行代码,error了,如下 command codesign failed with a nonzero exit code 解决 1. clean一下,command+shift+k 2. 重启电脑,重新运行
1 2 3 4 5 ... 20
收藏数 137,119
精华内容 54,847
关键字:

1005 code ios