我使用的是自定义UITableViewCell
。当我尝试运行我的代码,我得到这个异常堆栈和我无法理解问题的根源:无效的笔尖注册标识符((null)) - 笔尖必须包含一个顶级
terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'invalid nib registered for identifier ((null)) - nib must contain exactly one top level object which must be a UITableViewCell instance'
请注意,我没有使用故事板。
编辑:
这是我的相关代码根据断点引起的问题:
[tableviewSupport registerNib:[UINib nibWithNibName:@"HotelCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:CustomCellCId];
为了调试的目的,我建议将代码行分成两部分。将UINib对象加载到变量中,并在尝试注册之前测试它是否成功。 – 2012-04-03 16:14:23