title: IOS - performSelector:withObject:afterDelay: NOT WORKING
body: <p><strong>Reference :</strong> </p>
  
  <p><a href="https://stackoverflow.com/a/14741253/1749293">https://stackoverflow.com/a/14741253/1749293</a></p>
  
  <p>Like the link above said ,  but it seems that it doesn't explain the reason.</p>
  
  <p>In my code, the following will work :</p>
  
  <pre><code>dispatch_async(dispatch_get_main_queue(), ^{
         [self performSelector:  @selector(helloWorld) withObject:nil afterDelay:0.5];
  }); 
  </code></pre>
  
  <p>but, when i comment something like this , （and I really sure that I run it in the main thread！！）the code doesn't work  : </p>
  
  <pre><code>//    dispatch_async(dispatch_get_main_queue(), ^{
          [self performSelector:  @selector(helloWorld) withObject:nil afterDelay: 0.5];
  //    });
  </code></pre>
  
  <p>Can somebody tell me why ? <strong>AND</strong> ' self ', will nerver release/deallocated , i retain it until the application is over. </p>
  
  <p>" Not Working " , means that , (no crash) it doesn't jump into "helloWorld" method :</p>
  
  <pre><code>-(void) helloWorld {
      NSLog(@"hello world");     // I set a break point here for debug , it wouldn't pause forever
  }
  </code></pre>
  
  <p>I think is the <strong>Run Loop</strong> cause this problem . Like <a href="https://stackoverflow.com/a/14741253/1749293">this link</a> said , but i need more details or more explicit explain.</p>