Can I get a list of selectors delayed with performSelector:withObject:afterDelay:?

221 views Asked by At

I would like to be able to cancel delayed selectors individually. I can do his with [NSObject cancelPreviousPerformRequestsWithTarget...] but need all the method parameters to do this. At the point where I want to cancel, I don't have them.

Is there a way to get the list of selectors that are delayed together with the parameters used to delay the selectors?

The workaround is to just keep track of the parameters, of course. Or to use GCD and make my selectors (now blocks) check to see whether they should immediately return.

1

There are 1 answers

2
justin On BEST ANSWER

not directly. an easy way to accomplish this is would use NSOperation - then just hold references to the operations you may need to cancel in the future.