When I call
scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:
on the main thread and set time interval to 5 seconds code below timer gets executed, and after 5 seconds timer selector is called.
But if I try same in some background thread, the code below
scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:
will not be executed, it will wait for the timer to fire and then gets executed. Of course, in order to run the timer in the background thread, I first got an instance of NSRunLoop
and run it.
Is there a way to set the timer in the background thread and make it non-blocking, so code after it gets executed immediately?
Comments
Post a Comment