【发布时间】:2021-10-06 16:42:40
【问题描述】:
当我学习 tableviews 时,我遵循的教程使用了以下代码-
guard let cell = tableView.dequeueReusableCell(withIdentifier: Self.reminderListCellIdentifier, for: indexPath) as? ReminderListCell else {
return UITableViewCell()
}
我刚刚遇到了来自 Apple 的示例代码;
guard let cell = tableView.dequeueReusableCell(withIdentifier: Self.reminderListCellIdentifier, for: indexPath) as? ReminderListCell else {
fatalError("Unable to dequeue ReminderCell")
}
我应该实现什么?我相信 fatalError 会导致崩溃。是期望的行为吗?
【问题讨论】:
标签: ios uitableview