i am trying to develop a simple application that shows names from a database made in sqlite3.
It returns an error:
2012-08-21 21:10:43.182 NameDatabase[1325:c07] Assertion failure in -[UITableView _createPreparedCellForGlobalRow:withIndexPath:]; /SourceCache/UIKit_Sim/UIKit-1914.84/UITableView.m:6061 2012-08-21 21:10:43.184 NameDatabase[1325:c07] Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'
I have tried many things to fix the problem but i am out of ideas.
This is the method i think is causing the problem:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"CustomerCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
NameClass *name_class = [self.name_vc objectAtIndex:[indexPath row]];
cell.textLabel.text = name_class.name;
//[[cell textLabel] setText:[NSString stringWithFormat:@"%@ ,@%d",name_class.name, name_class.id]];
return cell;
}