Hi
I’m playing around with timers. Nothing “real” for not, but just to learn how to use them.
Starting a timer does work already, stopping it however doesn’t.
property currentValue : 0
property myTimer : class "NSTimer"
on start_(sender)
myTimer's scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_(0.2, me, "einsplus:", missing value, true)
end start_
on einsplus_(sender)
set currentValue to currentValue + 1
toggler's setTitle_(currentValue)
end einsplus_
on countstop_(sender)
myTimer's invalidate()
end einsminus_
All this test sample does is count a value.
As said, when you hit the start-button (binded with start_) the timer kicks in and counts.
but when you hit the stop button (binded with countstop_) nothing happens.
I also tried a few other things to stop the timer like:
myTimer's invalidate()
myTimer's invalidate(missing value)
myTimer's invalidate(true)
myTimer's invalidate_()
myTimer's invalidate_(missing value)
myTimer's invalidate_(true)
Non of these works however.
According the another post however, this should work:
http://macscripter.net/viewtopic.php?id=31692
http://macscripter.net/viewtopic.php?id=31488
It doesn’t however
Any idea why not?