0
我用xib创建了一个superCell
,并且子类继承父类,但子类没有xib,当我在tableView(: UITableView, cellForRowAt: IndexPath) -> UITableViewCell
协议中初始化子类时,我找不到xib的子视图,如何做?iOS子类继承父类Xib文件
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
//let cell = tableView.dequeueReusableCell(withIdentifier: "reuseIdentifier", for: indexPath)
let firstCell = FirstTableViewCell.init(style: .default, reuseIdentifier: "cell")
firstCell.test.text = "subCell"
return firstCell
}
你能显示你的代码吗? – Paulw11
请勿在评论中张贴代码。 [编辑]你的问题。 – rmaddy
第一个单元格继承BaseTableViewCell,而BaseTableViewCell具有xib文件,但第一个单元格没有 –