zoukankan      html  css  js  c++  java
  • iOS Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to

    刚接触iOS,依照教程操作执行出现错误

    Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier Cell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard


    解决的方法是加一句:

    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:CellIdentifier]; 


    加的位置是:

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 

        static NSString *CellIdentifier = @"ListPrototypeCell"; 
        [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:CellIdentifier]; 
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; 

        // config cell
     XYZToDoItem * toDoItem = [self.toDoItem objectAtIndex:indexPath.row];

        cell.textLabel.text = toDoItem.itemName;


       return cell; 
    }

    因为刚学习IOS,原因不明

  • 相关阅读:
    FatMouse's Speed --hdu
    poj 1182--食物链 (并查集)
    HDU
    CodeForces
    LightOJ
    HDU2717:Catch That Cow(BFS 队列)
    HDU
    51Nod
    bash: ifconfig: command not found 解决办法--------仅供参考
    关于“ORA-01653: 表 SYS.AUD$ 无法通过 128 (在表空间 SYSTEM 中)
  • 原文地址:https://www.cnblogs.com/yutingliuyl/p/7376159.html
Copyright © 2011-2022 走看看