title: How can I wait for a NSURLConnection delegate to finish before executing the next statement?
body: <p>This has been a hard one to search. 
  I found a similar question, <a href="https://stackoverflow.com/questions/8898231/ios-5-wait-for-delegate-to-finish-before-populating-a-table">iOS 5 Wait for delegate to finish before populating a table?</a>, but the accepted answer was 'Refresh the table view,' and that does not help me. The other results I found tended to be in c#.</p>
  
  <p>I have an app that streams from iPhone to Wowza servers. When the user hits record, I generate a unique device id, then send it to a PHP script on the server that returns a JSON document with configuration settings (which includes the rtmp dump link).</p>
  
  <p>The problem is, the delegate methods are asynchronous, but I need to get the config settings before the next lines of code in my <code>- (IBAction)recordButtonPressed</code> method, since that code is what sets the profile settings, and then records based on those settings. </p>
  
  <p>I've realized I could make the <code>NSURLConnection</code> in <code>-recordButtonPressed</code> like I am currently, and then continue the setup code <em>inside</em> the delegate method <code>connectionDidFinishLoading</code> (or just encapsulate the setup and method call it from there) but that's sacrificing coherent design for functionality and that sucks. </p>
  
  <p>Is there not some simple <code>waitUntilDelegateIsFinished:(BOOL)nonAsyncFlag</code> flag I can send to the delegator so I can have sequential operations that pull data from the web?</p>