tags:

views:

344

answers:

1

Hi, i want to show all rows in my tableview(when it loads) with red mark (negative symbol) in UITableViewCellStateShowingDeleteConfirmationMask....in other words if i click red mark ,it will show delete button for that particular row.... (edit button's action will be taken without pressing edit button) in table view. wiil you answer please? the following code gives run time error...and also the following code did not show minus red mark in each row?what i have to do?(i want to do without EDIT button)

(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSArray *deleteIndexPaths = [NSArray arrayWithObjects: [NSIndexPath indexPathForRow:indexPath.row inSection:0], nil];

[tableView beginUpdates];

[tableView deleteRowsAtIndexPaths:deleteIndexPaths withRowAnimation:UITableViewRowAnimationFade];

[tableView endUpdates];

}

+1  A: 

Check the UITableView documentation:

[tableView setEditing:YES animated:NO];
Alex Reynolds
hi, i am a student. i want clear explaination......
senthil
That line of code is all you should need. This puts your table view into editing mode. This is explained in the documentation.
Alex Reynolds
i am confusing , what i have to do? to add your code to my code
senthil
You need to read the documentation, I think. But you just add that line to your view controller, where you initialize your view.
Alex Reynolds