【发布时间】:2016-06-29 22:08:14
【问题描述】:
在另一个类中作为 NStimer 的选择器运行该函数时遇到问题。
class VariClass
{
func updateUILoop()
{
print("updating UI")
}
}
在我的应用委托中
let values = VariClass()
在我拥有的 appdelegate 中。
let timer = NSTimer(fireDate: NSDate(), interval: 5, target: self, selector: #selector(values.updateUILoop), userInfo: nil, repeats: true)
如果我手动运行该功能,它会完美运行。
getvalues.updateUILoop()
【问题讨论】: