xcode删除前先判断,选删除键才删除,怎么做啊??
xcode吧
全部回复
仅看楼主
level 1
lbq1043495251 楼主
//移除该成员
-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{
if (editingStyle == UITableViewCellEditingStyleDelete)
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"确定移除该成员吗" message:nil delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"移除", nil];
// Remove the row from data model
[tableData removeObjectAtIndex:indexPath.row];
// Request table view to reload
[tableView reloadData];
[alertView show];
}
}
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex==1)
{
}
}
2015年03月07日 03点03分 1
1