setTimeout doesn't work
Hi everybody,
I'm triying to use setTimeout in my app but it does not work at all.
Here my code.
On iphone sdk 4,2 & titanium 1.2.1
var my_timer = new countDown(0,20,
function() {
timer.text = my_timer.time.s;
},
function() {
label.hide();
label2.hide();
label3.hide();
win.add(notification);
//Refresh(data);
setTimeout('Refresh(data)', 1000);
}
2 Answers
-
For me this working
setTimeout(function() { Ti.App.fireEvent('hide_indicator'); },10000);
-
setTimeout is working for me also - it looks like you've got setTimeout embedded a few functions deep in your code. It might be worth isolating setTimeout in a simpler example to verify that/how it works, and then start stepping through your code to see at what point your logic breaks down.