开发者

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

I wou开发者_Python百科ld 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜