I have this code:
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
[array removeObjectAtIndex:indexPath.row];
if (editingStyle == UITableViewCellEditingStyleDelete)
{
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if(buttonIndex == 0)//OK button pressed
{
}
else if(buttonIndex == 1)//Annul button pressed.
{
}
}
I want to show alert view before I cancel a row of tableView, then put instruction of commitEditingStyle:(UITableViewCellEditingStyle)editingStyle in first if of UIAlert method delegate…
is it possible?
Save the cell’s indexPath to an ivar and use that information within the method called by the alert view.
In your implementation: