Open RichDaddyCashMany opened 6 years ago
有可能是你注册 cell 的姿势不对。
在 cellForRow 方法里面,检查一下不带 indexPath 的 dequeueReusableCell(withIdentifier:)
方法,是否会返回 nil
,如果会的话就是没有注册 reuse identifier。
要么在 viewDidLoad 里面用 tableView.register(MyCell.self, forCellReuseIdentifier: "cell")
注册,要么在 storyboard 里面填上 reuse identifier。
出现同样的问题,iOS 11真机
出现同样的问题, cell的注册在ViewDidLoad中进行
@Batxent 试试不要在registercell之前设置tableview的header或者footer
@ShaneFang 是的,这样确实就不会报错。但是问题的原因目前不详。
NSAssert(templateCell != nil, @"Cell must be registered to table view for identifier - %@", identifier);