这两天在写一个demo app,用到了tableview,涉及到了tablecell的重用,原代码如下:
直接run,点击tableViewController对应的页面时,则crash,crash Log如下:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier txTableCell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'
google了这个错误,回答挺多,看来跟我有类似问题的筒子很多,原因很简单。
这里cell的重用,我用了