timer - 在 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()`
任何帮助将不胜感激。
解决方案
推荐阅读
- next.js - 在 NextJS 中设置目录的正确方法
- python-3.x - 数据帧到 csv 文件不包括数字(表中的浮点数)和清理 '\n'
- python - Django 验证返回两个错误而不是一个
- c# - C# Windows 窗体使用 SQLite 数据库,打开连接时为 NullReference
- database - 获取数据库连接错误。MariaDB 经常关闭。该怎么办?
- python - 将数字添加到列表中的重复字符串
- php - laravel 7 'laravel.password_resets' 不存在
- sql - Oracle 按问题分组 sql 查询
- arrays - 解释请求:有序数组查找非重复元素
- c# - Unity 从 Windows Store 加载证书