How exactly cancelPreviousPerformRequestsWithTarget:selector:object: work?

933 Views Asked by At

I want to cancel the perform request registered for that particular target and method. e.g

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

Will above method cancel my all perform selector Request used in project irrespective of methods? OR will it remove only the perform request used in that particular class and for that particular method?

Please help me in understanding above concept.

1

There are 1 best solutions below

0
Syed Sadrul Ullah Sahad On BEST ANSWER

Cancels perform requests previously registered with the

performSelector:withObject:afterDelay:

instance method. All of the requests before executing this line.

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