coderyi/NetworkEye

iOS13 使用UISearchDisplayController导致崩溃

iimuy opened this issue · 10 comments

iimuy commented

在 iOS 8 之前,我们在 UITableView 上添加搜索框需要使用 UISearchBar + UISearchDisplayController 的组合方式,而在 iOS 8 之后,苹果就已经推出了 UISearchController 来代替这个组合方式。在 iOS 13 中,如果还继续使用 UISearchDisplayController 会直接导致崩溃,崩溃信息如下:
引用:https://www.jianshu.com/p/767e6f2d8435

好的,我会尽快支持

已经修改好了,1.0.9

还是报错,UISearchDisplayController is no longer supported when linking against this version of iOS. Please migrate your application to UISearchController ,我看到pod1.0.9里还是有UISearchDisplayController

我看你仓库的代码改了 ,pod的代码还是老的。

@Wbqqqq 现在可以了1.1.0

iimuy commented

@coderyi 目前库抓不到post请求,建议可以增加如下代码
post请求方式变了,可以自己实现这部分
在NEHTTPModel类的setNe_request:方法中实现
if ([ne_request HTTPBody].length>512) {
self.requestHTTPBody=@"requestHTTPBody too long";
}else if (![ne_request HTTPBody]){

   if ([ne_request.HTTPMethod isEqualToString:@"POST"]) {
          if (!ne_request.HTTPBody) {
             uint8_t rd[1024] = {0};
              NSInputStream *stream = ne_request.HTTPBodyStream;
               NSMutableData *data = [[NSMutableData alloc] init];
             [stream open];
              while ([stream hasBytesAvailable]) {
                  NSInteger len = [stream read:rd maxLength:1024];
                if (len > 0 && stream.streamError == nil) {
                    [data appendBytes:(void *)rd length:len];
                  }
              }
              self.requestHTTPBody=[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
              [stream close];
        }
    }

}

如果您有时间的话可以直接提交 Merge Request

iimuy commented

@coderyi 好的,晚上我搞下。

非常谢谢