且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Swift:自定义单元格中的IBoutlet为零

更新时间:2022-12-28 16:18:17

问题是这一行:

self.timesheetTable.registerClass(TimesheetTableViewCell.self, forCellReuseIdentifier: "TimesheetCell")

删除它。该行说:从故事板中获取单元格。但是你想要从故事板中获取单元格。

Delete it. That line says: "Do not get the cell from the storyboard." But you do want to get the cell from the storyboard.

(但是,请确保单元格的标识符是故事板中的TimesheetCell,否则你会崩溃。)

(Make sure, however, that the cell's identifier is "TimesheetCell" in the storyboard, or you'll crash.)