tableView Crash
转自: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的更多相关文章
- Crash以及报错总结
CoreData: Cannot load NSManagedObjectModel.nil is an illegal URL parameter 这是因为在工程中CoreData的命名和AppDe ...
- tableview的重用机制(面试必问)
iphone重用机制是苹果为了实现大量数据显示而采用的一种节省内存的机制,比如在UITableView和ScrollView 等地方.为什么要“可重用”???对于我们的项目来说,内存控制是必不可少的, ...
- iOS:项目中疑难Crash问题集锦
项目中疑难Crash问题集锦 iOS App运行中遇到Crash的情况相信大家都遇到过,开发和者测试中遇到了可能很方便的办法就是直接拿着设备连接一下,然后使用Xcode自带的工具就可以解析出Crash ...
- iOS 数组越界 Crash加工经验
我们先来看看有可能会出现的数组越界Crash的地方. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSInd ...
- UITableView.m:8042 crash 崩溃
CRASH : /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3600.6.21/UITableView.m:804 ...
- iOS开发笔记之TableView优化
TableView相信只要是做iOS开发的就不会陌生,目前大多数iOS的app都是采用TabBar+NavigationBar+TableViewController这一主流框架, 既然用的这么频繁, ...
- tableview的reloadData应注意
http://blog.csdn.net/ouyangtianhan/article/details/7835041 http://stackoverflow.com/questions/160715 ...
- iOS.Crash.OniOS8.WhenCall[popToRootViewController]
系统iOS 8.x, ARC. CrashCase: 在UIViewController中有一个类型为UIScrollView的实例变量scrollView, 点击UIViewController中的 ...
- 关于tableview下拉刷新崩溃的问题
逻辑应该是这样的:1. 下拉2. 达到下拉临界值以后再请求网络数据3. 待数据加载到本地以后才更新 data source4. reload tableview 如果先清空再下拉,后果就是往下拉的距离 ...
随机推荐
- RS232及RTS和CTS
EIA RS-232-C标准 EIA RS-232-C是由美国电子工业协会EIA制定的串行通信物理接口标准.最初是远程数据通信时,为连接数据终端设备DTE(Data Terminal Equipmen ...
- Linux [Ubuntu 12.0.1] 常用命令
1.文件名颜色的含义1)默认色代表普通文件.例:install.log2)绿色代表可执行文件.例:rc.news3)红色代表tar包 文件. 例:vim-7.1.tar.bz24)蓝色代表目录文件. ...
- 【HDOJ】2363 Cycling
二分+Dijkstra. #include <iostream> #include <cstdio> #include <cstring> #include < ...
- Linux Kernel ‘test_root()’函数本地拒绝服务漏洞
漏洞名称: Linux Kernel ‘test_root()’函数本地拒绝服务漏洞 CNNVD编号: CNNVD-201306-432 发布时间: 2013-06-25 更新时间: 2013-06- ...
- Linux企业级开发技术(3)——epoll企业级开发之epoll模型
EPOLL事件有两种模型: Edge Triggered (ET) 边缘触发 只有数据到来,才触发,不管缓存区中是否还有数据. Level Triggered (LT) 水平触发 只要有数据都会触 ...
- 测试使用wiz来发布blog
晚上尝试了下用wiz写随笔并发布,貌似成功了,虽然操作体验和方便性上不如word,但起码它集成了这个简单的功能可以让我用:如果能让我自动新建blog文章并自动定时更新发布就完美了.2013年7月5日1 ...
- 图论(无向图的割顶):POJ 1144 Network
Network Description A Telephone Line Company (TLC) is establishing a new telephone cable network. ...
- IOS的 testflight测试设置
管理员邀请参与者 1.登录开发者账号https://developer.apple.com/account 2.进入后,点击ituns connect 3.点击进入用户和职能 4.在用户栏点击添加按钮 ...
- UVAlive2531 The K-League(最大流)
题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=33451 [思路] 最大流. 大体思路是枚举每个队伍,最大流判断是否 ...
- eclipse下开发简单的Web Service
service部分 在eclipse下新建一个动态web项目 在项目中新建一个service类 编写SayHello类的代码 package org.sunny.service; //包不要引用错了 ...