One possibility is to use Grand Central Dispatch, namely dispatch_after() :
double delayInSeconds = 2.0; dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_after(popTime, queue, ^{ ... });
Instead of dispatch_get_global_queue() you can also create your own dispatch queue or use the main queue with dispatch_get_main_queue() .
source share