找到异常原因(异常名为内部不一致异常)
///找到这一行
Terminating app due to uncaught exception 'NSInternalInconsistencyException'
///继续看下去如:
reason: 'UITableView dataSource returned a nil cell for row at index path:... ...
///找到这段英文中出现的自己的类名 如:
<XMShoppingTableView: 0x14299ae00>>>'
通过异常名字和控制台给出的错误,大致可以分析到是单元行出错(因为tableView使用的代理方法只有初始化的时候赋值是由咱们进行赋值的)
解决问题
在cellForRowAtIndexPath方法中打断点,一步步执行,找到单元格不是UItableViewCell类型的原因(我这里是因为没有进行初始化,值为nil
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;