Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cancel [self performSelector:... withObject:nil afterDelay:20];

Tags:

xcode

iphone

ios4

I call method sr in viewDidLoad with below code,how can i cancel it before that method sr will call?

[self performSelector:@selector(sr) withObject:nil afterDelay:20];  
like image 362
SajjadZare Avatar asked Feb 20 '11 07:02

SajjadZare


1 Answers

[NSObject cancelPreviousPerformRequestsWithTarget:self                                          selector:@selector(sr)                                            object:nil]; 

Please read the documentation. :) The documentation for -performSelector:withObject:afterDelay: points you to the methods for canceling a queued perform request.

like image 105
CIFilter Avatar answered Sep 21 '22 21:09

CIFilter