title: How to synchronize two asynchronous delegate methods callbacks in iOS?
body: <p>I'm writing a simple weather app to try to solidify my understanding of protocols and delegates. I'm in the following situation:</p>
  
  <ul>
  <li>I have 2 data sources for weather data (Just NSObjects at this time) and a view controller that I want to update once I have received data from <strong>both</strong> sources.</li>
  <li>The 2 data sources have protocols that I adhere to in the view controller. Their delegate methods are called once they have received data from their own web service. This could mean that Data Source 1 gets data before Data Source 2, vice-versa, or at the same time (don't know 100% if this is possible)</li>
  <li>I only want to update the view once I have received data from both sources.</li>
  </ul>
  
  <p>What would be the best way to do this? I was thinking of nesting the delegate methods, where Data source 1 would notify Data source 2 when it has data (through protocols), then have data source 2 notify the view controller to update the view when it has data. However I don't think this is the correct/best way to do things.</p>
  
  <p>Any Ideas?</p>
  
  <p>Thanks</p>