The following is being used as the code to put a tableviewcell from a nib file into the tableview. I have taken the tableviewcell in the same nib as that of the tableview. I have tried initializing the cell in the viewdidload also but to no go.
- (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;
}
The error that I get is
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'
I have checked connections in the IB and rewired them too but the result comes up the same. When I try NSLog’ing the cell, it comes as null.
You need to do it like so
Im not sure if you need that if but I thought I include it.