My problem is, at some point in my application I call [performSelector: withObject: afterDelay:] but during the delay which can be up to 1 second several things happen that decide whether the delayed method should or should not be called, however, once registered, the selector can’t be unregistered so it will be called anyway. I tried to put a flag, but because [performSelector: withObject: afterDelay:] can get called several times in a second using one flag fails.
I guess I somehow need to be able to stop the specific method before it gets called. Is this even possible?
The
cancelPreviousPerformRequestsWithTarget:method will remove any such queued perform operations.