I am trying to show minus symbol when I show data from an sqlite database, but if we show an edit button it shows a delete symbol. I am using navigation controller to show data. I want to show when the page loads, it must be with a "-" symbol without edit button? Does anyone have an example or tutorial?


If I understand you correctly, you want to delete the row immediately, without confirmation of tapping a delete button.

First: Users are used to having a delete button confirmation, and if you delete immediately, they may be surprised.

Second: If the issue is deleting many rows quickly, could you instead allow the user to select multiple rows and delete them all at once (like in the email app)

Third: A solution to your question:

Make a custom UITableViewCell and override this function

- (void)willTransitionToState:(UITableViewCellStateMask)state {
    if (state && UITableViewCellStateShowingDeleteConfirmationMask) {
        [delegate deleteCell:self];

You will need to also have a delegate property on the UITableViewCell subclass and set it to your view controller whenever you create a new cell. Then add this function in your view controller:

- (void) deleteCell:(UITableViewCell *)cell {
    NSIndexPath *idx = [self.table indexPathForCell:cell];
    if (idx) {
        NSArray *arr = [NSArray arrayWithObject:idx];
        //Delete from database here
        if (/*delete success*/) {
            [self.tableView deleteRowsAtIndexPaths:arr withRowAnimation:UITableViewRowAnimationFade];
Ed Marty
your code is to delete the row without confirmation.but i ask each row must be there whe the tableview loads,but each row must have_ symbol from the beginning ,if i press that (- symbol), delete button will come at the end of the particular row,if i press the button ,the row will be deleted.that is my need.wiil you answer please?

Still not sure exactly what you're looking for, but if I understand better this time, you just want the - symbol to show up as soon as the view appears?

- (void) viewDidLoad {
    [super viewDidLoad];
    [self.tableView setEditing:YES];
Ed Marty