When using NSURLConnection, there are several methods to be watching… I understand that connection:didReceiveResponse: could potentially be fired several times during a connection.
At what point is it safe to start working with the received information? Within connectionDidFinishLoading:?
In my project, I am appending the received data in connection:didReceiveData: by setting:
// append the data
[receivedData appendData:data];
Then I’m actually doing stuff with the results within the connectionDidFinishLoading: … creating my NSDictionary with TouchJSON, looping through the data and changing my UI.
Am I doing it correctly?
connectionDidFinishLoadingis the correct place to start working with the received data.didReceiveDatais the correct place to append the newly received data (notdidReceiveResponse).didReceiveResponseis a good place to check HTTP status codes etc.