tableView.dequeueReusableCellwithIdentifier:“”,forindexPath)触发除断点以外的所有点

问题描述 投票:0回答:2

当我打开All Excepts断点时,我的程序在tableView.dequeueReusableCellwithIdentifier处停止。 -Xcode 11-单击继续执行程序,App没有崩溃。为什么?

enter image description here

ios swift uitableview breakpoints xcode11
2个回答
0
投票

我认为问题是关键字private。这导致Cocoa(这是Objective-C)无法看到您已经实现了JTCustomerMainCell类。它看不到它,所以它没有调用它。删除该关键字,就可以了。检查并找到这样

private class JTCustomerMainCell: UITableViewCell {
(...)
}

0
投票

您需要先注册单元格。

override func viewWillAppear(_ animated: Bool) {
    tableView.register(JTCustomerMainCell, forCellReuseIdentifier: "JTCustomerMainCell")
}
© www.soinside.com 2019 - 2024. All rights reserved.