根據文檔:
Zero or more connection:didReceiveResponse: messages will be sent to the delegate before receiving a connection:didReceiveData: message. The only case where connection:didReceiveResponse: is not sent to a delegate is when the protocol implementation encounters an error before a response could be created. Zero or more connection:didReceiveData: messages will be sent before any of the following messages are sent to the delegate: connection:willCacheResponse:, connectionDidFinishLoading:, connection:didFailWithError:.
所以,除非有一個錯誤,你能保證你會得到一個connectionDidFinishLoading之前得到didReceiveResponse。
這可能是一個跛腳的問題,但什麼構成的響應被創建之前的錯誤:在當所述協議實現遇到錯誤可以創建一個響應之前 – cynistersix