Data from SQLite database is valid until - tableview cellForRowAtIndexPath. I've stripped down the code to it most basic, and still don't see the problem. Connections are made in IB, and data shows on console. Obviously I'm new to Cocoa/Obj C.
Code in:
-(UITableViewCell *)tableView
UITableView *)tableView
cellForRowAtIndexPath
NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier
"TableViewCell"];
if (cell =nil) {
cell = [[[UITableViewCell alloc]initWithFrame:CGRectZero
reuseIdentifier: @"TableViewCell"] autorelease];
}
NSUInteger row = [indexPath row];
cell.textLabel.text = [cities objectAtIndex:row];
return cell ;
}
Error msg:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'
2009-09-29 19:14:25.537 testAER[9939:20b]
Code in:
-(UITableViewCell *)tableView
cellForRowAtIndexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier
if (cell =nil) {
cell = [[[UITableViewCell alloc]initWithFrame:CGRectZero
reuseIdentifier: @"TableViewCell"] autorelease];
}
NSUInteger row = [indexPath row];
cell.textLabel.text = [cities objectAtIndex:row];
return cell ;
}
Error msg:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'
2009-09-29 19:14:25.537 testAER[9939:20b]