title: Macro to run method on main thread
body: <p>I want an easy way to drop code in the beginning of a method that will force the method to only be run on the main thread (because the method updates UI elements).</p>
  
  <p>Currently, I have something like:</p>
  
  <pre><code> if (![NSThread isMainThread]){
      [self performSelectorOnMainThread:_cmd withObject:_results waitUntilDone:NO];
      return;
  }
  </code></pre>
  
  <p>but I want a way to include this in a macro without me having to enter the arguments for the method. It seems like there should be some way to iterate over the list of parameters passed to the current method and create an NSInvocation or similar. Any thoughts?</p>