Swift: IBoutlets are nil in Custom Cell

喜欢而已 提交于 2019-11-28 12:23:42

The problem is this line:

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.

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

Pretty sure that you need to remove the line

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

from viewDidLoad().

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!