【发布时间】:2013-11-12 03:34:19
【问题描述】:
我正在尝试按照本教程进行操作,但我得到了空表。
首先,教程正在使用
{
CarTableViewCell *cell = [tableView
dequeueReusableCellWithIdentifier:CellIdentifier
forIndexPath:indexPath];
}
我遇到了一个错误:
2013-11-12 11:29:35.940 TableViewStory[14940:70b] *** Terminating app due to uncaught
exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with
identifier carTableCell - must register a nib or a class for the identifier or connect a
prototype cell in a storyboard'
所以我补充说:
[self.tableView registerClass:[CarTableViewCell class]
forCellReuseIdentifier:@"carTableCell"];
在我的 viewDidLoad 上。添加 registerClass 后,我能够构建我的应用程序。但是我的桌子空了。
谢谢。
【问题讨论】:
-
您是否在情节提要中为您的单元格指定了一个标识符?如果是这样,请确保拼写正确。如果您在情节提要中设计了单元格,则不需要注册课程(实际上您不应该)。
标签: iphone objective-c uitableview ios7 xcode5