无法设置自定义单元格 class 的变量

can't set custom cell class's variable

我创建了一个 table 视图,单元格是自定义样式,我确实将单元格与自定义 class 和 dequeueReusableCell(withIdentifier: , for:) 函数中的单元格 ID 连接起来。

我在单元格中添加了一个图像视图,并将其作为 IBOutlet 添加到自定义单元格 class 中。在自定义单元格 class 中,我创建了名为 tableImage 的 get 和 set 变量来更改图像视图中的图像。

但是在

override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell

我还是无法设置table图片。错误显示 UITableViewCell 类型的值没有成员 tableImage.

你加为了吗! dequeueReusableCell 函数之后的 yourCustomTableViewCell?

yourTableView.dequeueReusableCell(withIdentifier: "yourCell", for: indexPath) as! yourCustomTableViewCell