我正在使用最新的alamofire版本5.2.1来使WEB API调用它与所有API完美结合但是,当我为国家/地区列表调用api时,它在URL Session Delegate类中崩溃
open func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
eventMonitor?.urlSession(session, dataTask: dataTask, didReceive: data)
if let request = request(for: dataTask, as: DataRequest.self) {
request.didReceive(data: data)
} else if let request = request(for: dataTask, as: DataStreamRequest.self) { //Crash at this line
request.didReceive(data: data)
} else {
assertionFailure("dataTask did not find DataRequest or DataStreamRequest in didReceive")
return
}
}
同一请求对正常的URL会话非常有效,邮递员只有alamofire无法处理响应,我正在附上屏幕截图以获取更多详细信息。
响应包含2000行json,但我不认为这是问题
贡献者在Xcode 11.4.1之后说,此问题已通过移至Xcode 11.4.1得以解决