I use the following method in a uiview subclass:
[self performSelector:@selector(timeout) withObject:nil afterDelay:20];
The method is called after 20 seconds, as expected. In another method, I am trying to cancel a request for execution using the following code:
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(timeout) object:nil];
I also tried
[NSRunLoop cancelPreviousPerformRequestsWithTarget:self selector:@selector(timeout) object:nil];
both messages do not produce the expected result until the timeout method is called. can someone explain to me what i am doing wrong and how to do it right?
cheers from austria martin
source share