博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
转:Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
阅读量:7124 次
发布时间:2019-06-28

本文共 1276 字,大约阅读时间需要 4 分钟。

Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]今天做一个tableView遇到一个这么个问题。经过baidu google,终于找到正解。因为- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath     *)indexPath这个函数的返回值是个null!!查stackoverflow 找到下面的解。CellIdentifier I bet your cellForRowAtIndexPath is returning null.- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath     *)indexPath{    static NSString *CellIdentifier = @"Photos";    /** NOTE: This method can return nil so you need to account for that in code */    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];    // NOTE: Add some code like this to create a new cell if there are none to reuse    if(cell == nil)    {        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];    }    NSString *string = [[self.photosInPlace objectAtIndex:indexPath.row]     valueForKeyPath:@"description._content"];    cell.textLabel.text = string;    return cell;}That's probably why [UITableView _configureCellForDisplay:forIndexPath:] is failing... becausecellForRowAtIndexPath is returning a null value and then configureCellForDisplay is expecting aUITableViewCell.

转:

转载地址:http://gfael.baihongyu.com/

你可能感兴趣的文章
python selenium系列(八)元素定位进阶之分层定位
查看>>
MySQL多表连接优化一例
查看>>
PHP动态扩展模块安装
查看>>
AgileEAS.NET平台开发实例-药店系统-UI层重构技巧及其他
查看>>
Go编程基础 - 类型与变量
查看>>
外链优化的发展
查看>>
用Java实现生产者和消费者的多线程例子
查看>>
alter database datafile offline drop 与 alter tablespace drop datafile 区别 .
查看>>
Java学习课程体系
查看>>
我的友情链接
查看>>
Python install 问题汇总
查看>>
我的友情链接
查看>>
JavaScript中的一些特殊用法(六)
查看>>
saltstack的安装及配置
查看>>
SCVMM 2012 SP1 安装与配置指南(四)配置SMI-S提供程序来添加iSCSI存储
查看>>
Spring 的优秀工具类
查看>>
MySQL源码编译安装(CentOS-6.6+MySQL-5.6)
查看>>
CentOS 7 基于fastcgi 的lamp
查看>>
linux大神必备技能
查看>>
C语言:不使用(a+b)/2这种方式(会溢出),求两个数的平均值
查看>>