title: Check whether or not the current thread is the main thread
body: <p>Is there any way to check whether or not the current thread is the main thread in Objective-C?</p>
  
  <p>I want to do something like this.</p>
  
  <pre><code>  - (void)someMethod
    {
      if (IS_THIS_MAIN_THREAD?) {
        NSLog(@"ok. this is main thread.");
      } else {
        NSLog(@"don't call this method from other thread!");
      }
    }
  </code></pre>