Posted By

yannxou on 11/16/13


Tagged

ios


Versions (?)

Execute a block after some delay


 / Published in: Objective C
 

enqueue a block at a certain time

  1. double delayInSeconds = 15.0;
  2. dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
  3.  
  4. dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
  5.  
  6. [self fooFirstInput:first secondInput:second];
  7.  
  8. });

Report this snippet  

You need to login to post a comment.