Я хочу продолжить вызов следующей функции для числа «n», я напишу этот код позже. Теперь я столкнулся с проблемой.Невозможно вызвать функцию из себя после интервала
func keepHighlighting(myLbl : UILabel)
{
myLbl.text = "hi"
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
{
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for : indexPath) as! TableViewCell
let mySelector = #selector(self.keepHighlighting(duaLbl : cell.tempLbl))
let timer = Timer.scheduledTimer(timeInterval: 0.4, target: self, selector: mySelector, userInfo: nil, repeats: true);
timer.fire()
return cell
}
Ошибка: Аргумент '#selector' не относится к '@objc' метода, свойства или инициализаторе
Вы понимаете, что при каждом вызове ваш 'timer' будет создавать снова? –
Вы правы, я позабочусь об этом, но столкнусь с проблемой в #selector –
@shallowThought Не работает –