title: IOS/Objective-C: returning to main thread
body: <p>I think I understand how the following works but would appreciate confirmation.</p>
  
  <pre><code>dispatch_async(kBgQueue, ^{
      NSData* data = [NSData dataWithContentsOfURL: dataUrl];
      [self fetchData:data];//go to web, get data and store in core data
  }
  dispatch_async(dispatch_get_main_queue(), ^{
      //display new data on main thread.
  }
  </code></pre>
  
  <p>My question is can I take it for granted that the display on the main thread will not take place until after the conclusion of everything that occurs in the background--no matter how long?  </p>
  
  <p>The reason I would appreciate confirmation is that occasionally I am observing some issues with the display.  Want to be sure the display is not trying to access core data when background thread has not finished saving to it.</p>