title: Is this the correct usage of an Operation Queue completion block?
body: <p>I'm using Objective-C blocks and Operation Queues for the first time. I'm loading some remote data while the main UI shows a spinner. I'm using a completion block to tell the table to reload its data. As the <a href="http://developer.apple.com/library/ios/#documentation/Cocoa/Reference/NSOperation_class/Reference/Reference.html#//apple_ref/occ/instm/NSOperation/setCompletionBlock%3a">documentation mentions</a>, the completion block does not run on the main thread, so the table reloads the data but doesn't repaint the view until you do something on the main thread like drag the table. </p>
  
  <p>The solution I'm using now is a dispatch queue, is this the "best" way to refresh the UI from a completion block?</p>
  
  <pre><code>    // define our block that will execute when the task is finished
      void (^jobFinished)(void) = ^{
          // We need the view to be reloaded by the main thread
          dispatch_async(dispatch_get_main_queue(),^{
              [self.tableView reloadData];
          });
      };
  
      // create the async job
      NSBlockOperation *job = [NSBlockOperation blockOperationWithBlock:getTasks];
      [job setCompletionBlock:jobFinished];
  
      // put it in the queue for execution
      [_jobQueue addOperation:job];
  </code></pre>
  
  <p><strong>Update</strong>
  Per @gcamp's suggestion, the completion block now uses the main operation queue instead of GCD:</p>
  
  <pre><code>// define our block that will execute when the task is finished
  void (^jobFinished)(void) = ^{
      // We need the view to be reloaded by the main thread
      [[NSOperationQueue mainQueue] addOperationWithBlock:^{ [self.tableView reloadData]; }];
  };
  </code></pre>