转自:http://blog.csdn.net/hamasn/article/details/8613593

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.

tableView Crash的更多相关文章

  1. Crash以及报错总结

    CoreData: Cannot load NSManagedObjectModel.nil is an illegal URL parameter 这是因为在工程中CoreData的命名和AppDe ...

  2. tableview的重用机制(面试必问)

    iphone重用机制是苹果为了实现大量数据显示而采用的一种节省内存的机制,比如在UITableView和ScrollView 等地方.为什么要“可重用”???对于我们的项目来说,内存控制是必不可少的, ...

  3. iOS:项目中疑难Crash问题集锦

    项目中疑难Crash问题集锦 iOS App运行中遇到Crash的情况相信大家都遇到过,开发和者测试中遇到了可能很方便的办法就是直接拿着设备连接一下,然后使用Xcode自带的工具就可以解析出Crash ...

  4. iOS 数组越界 Crash加工经验

    我们先来看看有可能会出现的数组越界Crash的地方. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSInd ...

  5. UITableView.m:8042 crash 崩溃

     CRASH : /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3600.6.21/UITableView.m:804 ...

  6. iOS开发笔记之TableView优化

    TableView相信只要是做iOS开发的就不会陌生,目前大多数iOS的app都是采用TabBar+NavigationBar+TableViewController这一主流框架, 既然用的这么频繁, ...

  7. tableview的reloadData应注意

    http://blog.csdn.net/ouyangtianhan/article/details/7835041 http://stackoverflow.com/questions/160715 ...

  8. iOS.Crash.OniOS8.WhenCall[popToRootViewController]

    系统iOS 8.x, ARC. CrashCase: 在UIViewController中有一个类型为UIScrollView的实例变量scrollView, 点击UIViewController中的 ...

  9. 关于tableview下拉刷新崩溃的问题

    逻辑应该是这样的:1. 下拉2. 达到下拉临界值以后再请求网络数据3. 待数据加载到本地以后才更新 data source4. reload tableview 如果先清空再下拉,后果就是往下拉的距离 ...

随机推荐

  1. JavaScript的应用

    DOM, BOM, XMLHttpRequest, Framework, Tool (Functionality) Performance (Caching, Combine, Minify, JSL ...

  2. IllegalArgumentException: Does not contain a valid host:port authority: master:8031

    java.lang.IllegalArgumentException: Does not contain a valid host:port authority: master:8031 (confi ...

  3. I2C转UART

    I2C转UART,51单片机普通IO口模拟I2C从机,解决UART不够的问题 /************************************************************ ...

  4. 【HDOJ】1483 Automatic Correction of Misspellings

    水模拟题. /* 1483 */ #include <cstdio> #include <cstring> #include <cstdlib> #define M ...

  5. C++中自己理解的一些细节哈

    对于大牛来说,我写的可能很低级哈,留给自己看,以后遇到的都慢慢补充哈!^^ 1.每一个类定义结束后,不要忘了在类的结束符"}"后面加上一个";"哦! 2.构造函 ...

  6. [转]关于Icon,Image,ImageIcon的简单的对比参考

    转自:http://blog.csdn.net/bcmissrain/article/details/7190886 其实就算是现在,我还是有不少地方概念模糊,但是下面的内容是是没有什么问题的.稍微介 ...

  7. (转载)mysql查询今天、昨天、7天、近30天、本月、上一月数据

    (转载)http://blog.163.com/dreamman_yx/blog/static/26526894201053115622827/ 查询 今天 select * from 表名 wher ...

  8. 数据结构(线段树):BZOJ 1568 [JSOI2008]Blue Mary开公司

    1568: [JSOI2008]Blue Mary开公司 Time Limit: 15 Sec  Memory Limit: 162 MBSubmit: 602  Solved: 214[Submit ...

  9. Ubuntu安装ARM架构GCC工具链(ubuntu install ARM toolchain)最简单办法

    一.安装ARM-Linux-GCC工具链 只需要一句命令: sudo apt-get install gcc-arm-linux-gnueabi 前提是你的Ubuntu系统版本是官网支持的最新的版本, ...

  10. 芭比娃娃 Barbara

    芭比娃娃(芭比)是20世纪最广为人知及最畅销的玩偶,由Ruth Handler发明,于1959年3月9日举办的美国国际玩具展览会(American International Toy Fair)上首次 ...