「iOS6 UITableViewのセルの再利用の方法が変わった」らしい 2013/05/28

!!この記事はよく考察されてない状態で書かれています。!!

 こんな感じのエラーはいておちまてます。

*** 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'

とくにコードは問題ないかな。

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
  
    // Configure the cell...
    if (!cell) { // yes
        // セルを作成
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
   
    return cell;
}

落ちるのは落ちたので、調べてたたら

iOS6 UITableViewのセルの再利用の方法が変わった | Developers.IO

上記の記事をみつけまして、

とりあえず、
 
- (void)viewDidLoad
{
    [super viewDidLoad];
   self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"Cell"];
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

viewDidLoadにコードを追加したら落ちなくなりました。

とりあえず。。。

: