为什么这件事崩溃只是无法弄清楚
var request = URLRequest(url: URL(string: url)! )
request.httpMethod = "POST"
request.httpBody = try! JSONSerialization.data(withJSONObject: params, options: [])
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
let task = URLSession.shared.dataTask(with: request, completionHandler: {data, response, error -> Void in
guard let responceSafe = response else {
completion([:], 0)
return
}
/*some not related code*/
}
这里错误日志看起来有多奇怪:
Assertion failed: (isForProxy(authConfig.getConnectionType())), function updateWithResponse, file /BuildRoot/Library/Caches/com.apple.xbs/Sources/CFNetwork/CFNetwork-808.0.2/HTTP/HTTPAuthentication/AuthenticationHelpers.cpp, line 1168.
答案 0 :(得分:1)
对我来说,是InMobi惹麻烦了。 InMobi是第3个SDK。 当我删除有关它的代码时,崩溃就会消失!