Background: During the handshake process, my iOS app learns the server capabilities by
-
Checking its header information in
didReceiveResponseAND
- Parsing its response XML in
connectionDidFinishLoading
Problem statement: Since callback #1 precedes #2, I am storing the version string in didReceiveResponse and checking it later in connectionDidFinishLoading when the response is available.
This fortunately works fine so far because #1 preceeds #2. But is that order always guaranteed by network / iOS?
According to the documentation:
So unless there’s an error, you can guarantee that you’ll get a didReceiveResponse before getting a connectionDidFinishLoading.