title: Performing App Delegate method on main thread from secondary thread
body: <p>I have a Iphone app with 2 threads. One is listening to the server, and the other is doing UIKit, OpenGl stuff.</p>
  
  <p>I need to run a method that updates a view from the secondary thread thats listening to a server on the main thread that handles the views so I used</p>
  
  <pre><code>performSelectorOnMainThread:@selector"createGuessingView" withObject:nil waitUntilDone:YES
  </code></pre>
  
  <p>but for some reason, the method never gets executed. Putting a breakpoint or a printf at the beginning of the method shows that its never invoked. Im really stumped here. Ive used <code>performselectoronmainthread</code> in the same program to update text fields and it worked flawlessly.</p>
  
  <p>edit:</p>
  
  <p>Figured it out :)
  The problem was that the object that I was using performSelectorOnMainThread was set by this thread before the object was initialized (even allocated) in the main thread. Therefore, the reference was pointing to null, and the selector was not getting recognized.</p>
  
  <p>Thanks for the help</p>