I've been playing with an experimental/demo application to get the hang of timers, andhave come across an issue with canceling a performSelector:withObject:afterDelay:.
Nothing too earth shattering, I was just wanting to use a delay before some processing
to give me a chance to test/watch the rest of the user interface, for example:
performSelector_withObject_afterDelay_("startProcessTimer:", "timer started...", 4)
It is a short enough delay, but if I want to cancel it and proceed (by using it in a button
handler, for example), I can't seem to get it to cooperate:
cancelPreviousPerformRequestsWithTarget_(me) -- ???:
I am using other timers, which have an instance I can invalidate, but the cancel gives
me an "unrecognized selector" message no matter what I try to put in as the target,
which for lack of a specific definition of "(id)aTarget" I am assuming to be the same
script object (or application or run loop) that started the delay.
I've found few examples of this (mostly iPhone), but as far as I can tell it should be fairly
straightforward to use. Is this one of those things that needs an ObjC wrapper, or am I
just using it wrong?
Thanks,
Dave