【发布时间】:2015-01-14 13:01:03
【问题描述】:
我正在尝试通过在我的视图控制器中使用一个函数来在我的自定义 tableViewCell 类中设置一个函数。我真的不知道如何做到这一点,所以我试着这样写:
TableViewCell.timerStarted()
我试图启动的功能如下所示:
func timerStarted(){
timer = NSTimer.scheduledTimerWithTimeInterval(1, target: self, selector: "update", userInfo: nil, repeats: true)
}
其中 TableViewCell 是我的类的名称, timerStarted 是函数的名称。这给了我一个错误,说它错过了括号内的参数。
我很困在这里,任何建议将不胜感激。
【问题讨论】:
标签: ios function class swift custom-cell