views:

35

answers:

1

Hello,

I am implementing the following tableview method:

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath

The problem is, when this gets hit, indexpath.row is showing up as out of scope. I am trying to handle the delete button for this row so I can delete the cell and delete the value out of the tableview's datasource.

A: 

What you are seeing is xCode's debugger being goofy. This happens a bunch. What I do is make a local variable like this and set my breakpoint there and the debugger will act better.

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
NSIndexPath temp = indexPath; //Set Debugger after this and you can inspect the variable.
}
Brad Smith
Same results...
Dave C