2016-09-14 60 views
2

爲什麼這件事情只是崩潰想不通URLSession.shared要求轟然斯威夫特3

 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. 

回答

1

對於我來說,這是誰的InMobi麻煩。 InMobi是第三個SDK。 當我刪除關於它的代碼時,崩潰消失了!