iPhone - NSTimer not repeating after fire

前端 未结 8 1836
被撕碎了的回忆
被撕碎了的回忆 2021-02-19 16:14

I am creating and firing a NSTimer with:

ncTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                           target:sel         


        
8条回答
  •  我寻月下人不归
    2021-02-19 16:42

    Swift timer with closure:

        let timer = Timer.scheduledTimer(withTimeInterval: 1, repeats: true) { _ in
             // Do whatever
        }
        timer.fire()
    

提交回复
热议问题