У меня проблемы с компилятором моего проекта UITableViewCell - PullRequest
0 голосов
/ 24 марта 2019

Когда я строю код, это нормально.Но после запуска у меня есть 2 ошибки:

  1. Thread 1: signal SIGABRT
  2. Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)

    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "CellIdentifier", for: indexPath as IndexPath) as! customTableViewCell
        cell.transAmount?.text = "cell number \(indexPath.row)."
        cell.transDate?.text = "cell number \(indexPath.row)."
        return cell
     }
    

Отладкапоказывает ошибку в:

let cell = tableView.dequeueReusableCell (withIdentifier: "CellIdentifier", для: indexPath as IndexPath) как!customTableViewCell

1 Ответ

0 голосов
/ 24 марта 2019

Полагаю, вы используете другой идентификатор или ячейку, не настроенную в раскадровке, как customTableViewCell

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...