Nik
Nik

Reputation: 1777

How exactly cancelPreviousPerformRequestsWithTarget:selector:object: work?

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.

Upvotes: 1

Views: 1038

Answers (1)

Syed Sadrul Ullah Sahad
Syed Sadrul Ullah Sahad

Reputation: 1312

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];

Upvotes: 1

Related Questions