three20数据源和表问题
问题描述:
为什么会收到以下错误:three20数据源和表问题
*** Assertion failure in -[TTTableView _createPreparedCellForGlobalRow:withIndexPath:], /SourceCache/UIKit_Sim/UIKit-1448.89/UITableView.m:5678
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'
*** Call stack at first throw:
我该如何解决这个问题?
的地步,它停止是:
- (void)layoutSubviews {
[super layoutSubviews]; //right here
这里面TTTableView.m
答
'的UITableView数据源必须的tableView返回细胞:的cellForRowAtIndexPath:'
有你的答案。你必须返回一个单元格。要么你的数据源没有设置或tableView:cellForRowAtIndexPath:没有返回任何东西。
+0
我意识到这一点,但我使用的实现https://github.com/RestKit/RestKit/blob/master/Code/Three20/RKObjectTTTableViewDataSource.m,它似乎并没有cellForRowAtIndexPath – adit
答
当使用RestKit + Three20在CoreData对象中填充TTTableViewController时,我遇到了同样的问题。
原来RKObjectManager
的objectStore
属性设置不正确。我在App初始化中修复了它,然后成功地填充了TTTableViewController。
委托回调以获取表格视图单元格不能为零。 – Joe
这是Three20和RestKit,你知道吗? – adit