以下は、テーブルビューセルをnibファイルからテーブルビューに配置するコードとして使用されています。テーブルビューと同じニブでテーブルビューセルを取得しました。viewdidloadでもセルを初期化しようとしましたが、うまくいきませんでした。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"identifier";
NSLog(@"the cellidentifier is %@", CellIdentifier);
bookmarksTableViewCell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
NSLog(@"the cell is %@", bookmarksTableViewCell);
return bookmarksTableViewCell;
}
私が得るエラーは
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'
IB で接続を確認し、それらも再配線しましたが、結果は同じです。セルを NSLog しようとすると、null になります。