title: Waiting for data to be loaded on app startup
body: <p>I'm pretty new to iOS development and been wrestling to tasks for a while. Decided to ask for help eventually.</p>
  
  <p>I have some data to be loaded from internet before I let the app to be launched. I've decided to use <code>didFinishLaunchingWithOptions</code> in <code>AppDelegate</code></p>
  
  <p>There it is:</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {    
      // Override point for customization after application launch.
  
      //loading configuration
      [Configuration downloadConfiguration:^(NSMutableArray *currencies, double refreshIntervalInMilis, double timeDifferenceInMilis, NSError *error)  {
          if (error) {
              //displaying error dialog
          } else {
              //doing some stuff with data loaded          
          }
      }];    
  
      return YES;
  }
  </code></pre>
  
  <p>It's obvious that the method will return YES before the data is loaded, because it doesn't wait for data to be loaded. My question is <strong>How do I make this method wait for this block be completed before I return YES</strong> (or NO if configuration was not loaded properly)?</p>