gpt4 book ai didi

ios - 为什么只有一个单元格返回零?

转载 作者:行者123 更新时间:2023-11-30 13:43:01 24 4
gpt4 key购买 nike

我创建了自定义单元并将其连接为:

let cell: statisticsCell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! statisticsCell

后来我将其用作:

cell.calendarLabel.text = recordsArray[indexPath.row].time
cell.dayLabel.text = "A \(recordsArray[indexPath.row].date)"
cell.amountLabel.text = "\(recordsArray[indexPath.row].count)"

但是当我运行我的应用程序时,只有这 3 个单元格中的这个单元格返回 nil 并导致我的应用程序崩溃:

cell.dayLabel.text = "A \(recordsArray[indexPath.row].date)"

该值不为零,我查了一下。

谁能告诉我为什么它返回零?为什么 3 个标签中只有一个返回 nil,而它却不是 nil?

崩溃

它崩溃了:

fatal error: unexpectedly found nil while unwrapping an Optional value

关于

cell.dayLabel.text

最佳答案

查看您是否已为 dayLabel 正确创建了导出并连接到 Storyboard 中的元素。

关于ios - 为什么只有一个单元格返回零?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35332322/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com