Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top