-2
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete)
{
NSLog(@"delet it");
// Delete the row from the data source.
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES];
}
else if (editingStyle == UITableViewCellEditingStyleInsert)
{
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view.
}
}
這是爲什麼這會導致我的應用程序崩潰?deleteRowsAtIndexPaths-crahes應用程序
'numberOfSections'和'tableView:cellForRowAtIndexPath:'如何編碼? – 2011-05-24 05:32:25
也許你忘了從數據源中刪除項目。 – Pierre 2011-05-24 05:37:51