相关疑难解决方法(0)

dequeueReusableCellWithIdentifier:forIndexPath中的断言失败:

所以我为我的学校制作了一个RSS阅读器并完成了代码.我跑了测试,它给了我这个错误.这是它所指的代码:

- (UITableViewCell *)tableView:(UITableView *)tableView 
         cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = 
     [tableView dequeueReusableCellWithIdentifier:CellIdentifier 
                                     forIndexPath:indexPath];
    if (cell == nil) {

        cell = 
         [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle  
                                reuseIdentifier:CellIdentifier];

    }
Run Code Online (Sandbox Code Playgroud)

这是输出中的错误:

2012-10-04 20:13:05.356 Reader [4390:c07] *断言失败 - [UITableView dequeueReusableCellWithIdentifier:forIndexPath:],/ SourceCache/UIKit_Sim/UIKit-2372/UITableView.m:4460 2012-10-04 20: 13:05.357 Reader [4390:c07]*由于未捕获异常'NSInternalInconsistencyException'而终止应用程序,原因:'无法使用标识符Cell对单元格进行出列 - 必须为标识符注册一个nib或类,或者在故事板中连接原型单元格" *第一掷调用堆栈:(0x1c91012 0x10cee7e 0x1c90e78 0xb64f35 0xc7d14 0x39ff 0xd0f4b 0xd101f 0xb980b 0xca19b 0x6692d 0x10e26b0 0x228dfc0 0x228233c 0x228deaf 0x1058cd 0x4e1a6 0x4ccbf 0x4cbd9 0x4be34 0x4bc6e 0x4ca29 0x4f922 0xf9fec 0x46bc4 0x47311 0x2cf3 0x137b7 0x13da7 0x14fab …

objective-c uitableview ios

322
推荐指数
8
解决办法
18万
查看次数

标签 统计

ios ×1

objective-c ×1

uitableview ×1