title: Objective-c/iOS: setting status text in async function is slow
body: <p>In my app I'm doing some communication with a remote server and as this might be slow I thought it would be a good idea to run that code asynchronously. I have my communication code in a block that I pass to dispatch_async. This code does the communication and when it's done it sets the text of a label. This last part is the problem. The text is set, but it occurs after a delay of a few seconds. This is my code.</p>
  
  <pre><code>- (void)doNetworkingTask {
      dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
  
          // Slow network task goes here.
  
          // Slow network task done, notify the user.
          [self.myLabel setText:@"task done."];
          NSLog(@"task done.");
      });
  }
  </code></pre>
  
  <p>What happens here is that my network task completes, the NSLog-text is logged and after a couple of seconds, the text of the label is updated. My question is 1) why does the label text not update instantly? and 2) what is a proper way of doing what I want to do? (do the slow network task without blocking anything else, update the user through a text label once I'm done.)</p>