Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

performSelector:withObject:afterDelay from class method not working

Any idea why this isn't working?

[self performSelector:@selector(foo:) withObject:argObj afterDelay:5.0];

I am calling this from within a class method, and it is calling another class method for the same class (hence 'self'). Is this valid?

I placed a breakpoint in foo, but it is not called. What's going on here?

like image 739
Steve N Avatar asked Feb 01 '11 00:02

Steve N


1 Answers

Do you have a run loop running on the thread from which you invoke the perform:afterDelay:? If not, it won't run.

like image 111
bbum Avatar answered Oct 30 '22 22:10

bbum