Potrzebuję wywołać metodę, gdy moja aplikacja się uruchamia, a następnie wywołać tę samą metodę co 5 sekund.Jak uruchomić NSTimer od razu?
Mój kod jest dość prosty:
// Call the method right away
[self updatestuff:nil]
// Set up a timer so the method is called every 5 seconds
timer = [NSTimer scheduledTimerWithTimeInterval: 5
target: self
selector: @selector(updatestuff:)
userInfo: nil
repeats: YES];
Czy istnieje opcja dla timera więc jest to wyzwalacz od razu, a następnie co 5 sekund?
Bardzo ładny składni! – loretoparisi