- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete)
{
//add code here for when you hit delete
NSLog(@"selected row is : %d",indexPath.row);
NSString *frndName = [[sections valueForKey:[[[sections allKeys] sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)] objectAtIndex:indexPath.section]] objectAtIndex:indexPath.row];
NSString *remove = [NSString stringWithFormat:@"Are you sure want to remove '%@' from your friends?",frndName];
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"" message:remove delegate:self cancelButtonTitle:@"Remove" otherButtonTitles:@"Cancel", nil];
av.title = frndName;
[av show];
}
}
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"editingStyleForRowAtIndexPath");
return UITableViewCellEditingStyleDelete;
}
-(NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
{
return @"Remove";
}