首页 > 解决方案 > 在 scheduleTimer 中使用 Unresolved Identifer

问题描述

我已经为此工作了一天,无法弄清楚出了什么问题。我已经搜索了here和文档,但仍然找不到答案。

这是代码:

`var counter = 60
 let timer = scheduledTimer(timeInterval:1.0, target: Any?, #selector(timerAction), userInfo: Any?, repeats: true)

 func timerAction() {
    for i in timer {
        counter -= 1
        print(counter)
  }

} timerAction()`

任何帮助将不胜感激。

标签: timer

解决方案


推荐阅读