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

I would like to be able to cancel pending selectors individually. I can do it with [NSObject cancelPreviousPerformRequestsWithTarget...] , but all the parameters of the method are needed for this. The moment I want to cancel, I do not have them.

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

The workaround is to simply track the parameters, of course. Or use a GCD and make my selectors (now block) check if they should return immediately.

+6
objective-c delayed-execution
source share
1 answer

not directly. an easy way to achieve this is to use NSOperation, and then just hold references to the operations that may be required to be undone in the future.

0
source share

All Articles