title: Objective-C wait for asynchronous HTTP-Request to finish
body: <p>I use the following code to execute a HTTP-Request:</p>
  
  <pre><code>NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:urlRequest delegate:self];
  </code></pre>
  
  <p>After that I want to use the received data. My problem is that i can't do this in connectionDidFinishLoading, but have to do this on another position in my code. As this is an asynchronous task, how can I verify that I don't start to use the received data before the task is completely done?</p>
  
  <p>Thanks in advance,</p>
  
  <p>Edit: My main problem is that the delegates are called after the code which uses the received data.</p>