title: What's the difference between performSelectorOnMainThread: and dispatch_async() on main queue?
body: <p>I was having problems modifying a view inside a thread. I tried to add a subview but it took around 6 or more seconds to display. I finally got it working, but I don't know how exactly. So I was wondering why it worked and what's the difference between the following methods:</p>
  <ol>
  <li>This worked -added the view instantly:</li>
  </ol>
  <pre><code>dispatch_async(dispatch_get_main_queue(), ^{
      //some UI methods ej
      [view addSubview: otherView];
  }
  </code></pre>
  <ol start="2">
  <li>This took around 6 or more seconds to display:</li>
  </ol>
  <pre><code>[viewController performSelectorOnMainThread:@selector(methodThatAddsSubview:) withObject:otherView
      waitUntilDone:NO];
  </code></pre>
  <ol start="3">
  <li><code>NSNotification</code> methods -  took also around 6 seconds to display the observer was in the viewController I wanted to modify paired to a method to add a subview.</li>
  </ol>
  <pre><code>[[NSNotificationCenter defaultCenter] postNotificationName:
   @&quot;notification-identifier&quot; object:object];
  </code></pre>
  <p>For reference these were called inside this <code>CompletionHandler</code> of the class <code>ACAccountStore</code>.</p>
  <pre><code>accountStore requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error) {
      if(granted) {
          // my methods were here
      }
  }
  </code></pre>