UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath
2014-07-01 00:25
387 查看
在处理tabViewCell时报了这个错误 UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath,
错误意思是:必须返回一个cell实例;
网上一搜, 出现这个错误的很多, 但原因也很多:
1. XIB没有连接正确(datasource, delegate), 这种情况比较多;
2. 自定义的tableViewCell未初始化;
而我的情况是第三种:
3. 在cellForRowAtIndexPath()方法中创建cell用的是[tableView
dequeueReusableCellWithIdentifier:identifier];i
而这里的identifier我并没有在xib中的cell中填写, 所以导致这个错, 填上对应的就可以了...
分享下, 希望也能帮到大家, 如有错误理解望指正。
错误意思是:必须返回一个cell实例;
网上一搜, 出现这个错误的很多, 但原因也很多:
1. XIB没有连接正确(datasource, delegate), 这种情况比较多;
2. 自定义的tableViewCell未初始化;
而我的情况是第三种:
3. 在cellForRowAtIndexPath()方法中创建cell用的是[tableView
dequeueReusableCellWithIdentifier:identifier];i
而这里的identifier我并没有在xib中的cell中填写, 所以导致这个错, 填上对应的就可以了...
分享下, 希望也能帮到大家, 如有错误理解望指正。
相关文章推荐
- 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:
- 关于错误 reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'
- UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath
- UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath
- Ios 该图显示其出现的相关问题定义UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'
- Ios 自定义表示图出现的相关问题UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'
- UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath
- UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:
- 关于UITableView 不能回调 tableView: cellForRowAtIndexPath的问题
- 使用自定义的tableViewCell- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NS
- 使用storyboard显示UITableView时,如果不修改系统默认生成的tableView:cellForRowAtIndexPath:方法中的代码,则必须为UITableViewCell注册(填写)重用标识符:identifier.必须要代码方法中的标识符一致.
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath不执行的问题
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;方法意思
- numberOfSectionsInTableView:,tableView:numberOfRowsInSecion:,tableView:cellForRowAtIndexPath:
- 关于tableView:cellForRowAtIndexPath的解释
- 在tableview 中的代理调用 [tableView cellForRowAtIndexPath:indexPath] 提示内存错误
- tableview:cellForRowAtIndexPath:不执行的原因
- UITableView不掉用tableView: cellForRowAtIndexPath方法
- tableView代理方法的调用时间,(主要是heightForRowAtIndexPath和cellForRowAtIndexPath调用时间)
- reason: 'UITableView failed to obtain a cell from its dataSource'