无法通过参数传递 Timer.sheduledTimer
Not able to pass Timer.sheduledTimer with parameters
basicPidTimer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(self.pidsUsage(indexPid:)), userInfo: pidsIndex, repeats: false)
//调用下面的方法但没有触发任何帮助?
@objc func pidsUsage(indexPid : Int){
}
参数的类型必须是Timer
。即
@objc func pidsUsage(timer : Timer) {
}
basicPidTimer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(self.pidsUsage(indexPid:)), userInfo: pidsIndex, repeats: false)
//调用下面的方法但没有触发任何帮助?
@objc func pidsUsage(indexPid : Int){
}
参数的类型必须是Timer
。即
@objc func pidsUsage(timer : Timer) {
}