Odd Timer Behavior

Something happens. When that occurs, I handle some data and then fire a timer (single mode).
In the timer’s action event I basically do the same something, and fire the timer again.

The problem is that the second time, the timer does not seem to respond.

In its action event, I set the mode to off, and now everything works as it should. Does not work this way on desktop (don’t have to turn the timer off).

Posting this here so it might be of use.

What is your code to “fire the timer again”?

Greg,

Self.timNext.Period = 1000
Self.timNext.Mode = Timer.modes.Single

[quote=466523:@Bob Gordon]Greg,

Self.timNext.Period = 1000
Self.timNext.Mode = Timer.modes.Single[/quote]
Ah, so on the desktop, the thing that makes this work is the Reset method, which isn’t available in Xojo.Core.Timer for some reason. I suspect that setting the mode to the same value just returns without making any change on iOS.

Why not do a Timer.CallLater(1000, …) ? I use this in my iOS app to take jobs off a queue and it works well.

I usually use CallLater, too. This project involves a desktop app and an iPad app, and I was keeping the code as similar as possible.