Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6073783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:18:33+00:00 2026-05-23T10:18:33+00:00

Well something is wrong but i dont know what. I cannot delete a row

  • 0

Well something is wrong but i dont know what. I cannot delete a row . when my tableview get in editmode red minus signs near all rows appear . touch on them make to appear delete button on row , whem i touch it it become (dark red) and nothing happens.

here is my code (not all) + i have no errors and warnings at compilation and runtime …

- (void)viewDidLoad {

    [super viewDidLoad];

    // initialize singleton.
    appDelegate = (ExchangedAppDelegate *)[[UIApplication sharedApplication]delegate];

    // get banks from settings.plist
    NSString *tempPath = [self getPathOfSettingsPlist];

    appDelegate.banks = [[NSArray alloc]initWithContentsOfFile:tempPath];

    navigationItem.rightBarButtonItem = self.editButtonItem;

    backButton = [[UIBarButtonItem alloc]initWithTitle:@"Back" style:UIBarButtonSystemItemCancel target:self action:@selector(closeSettingsView)];

    navigationItem.leftBarButtonItem = backButton;

}


- (void)setEditing:(BOOL)editing animated:(BOOL)animated {

    [super setEditing:editing animated:animated];

    [banksTableView setEditing:editing animated:animated];

    if (editing) {

        addButton = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addBankFromList)];

        navigationItem.leftBarButtonItem = addButton;

    } else {


        navigationItem.leftBarButtonItem = backButton;

        NSString *tempPath = [self getPathOfSettingsPlist];

        self.picker.hidden = YES;

        [appDelegate.banks writeToFile:tempPath atomically:YES];
    }

}



- (void)addBankFromList {

    // not interesting

}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return [appDelegate.banks count];
}


// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"BanksTableCell";

    indexForPath = indexPath;

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    if (cell == nil) {      

        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];

        cell.selectionStyle = UITableViewCellEditingStyleNone;
    }

    cell.textLabel.text = [appDelegate.banks objectAtIndex:indexPath.row];

    return cell;
}


// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle) editingStyle: forRowAtIndexPath:(NSIndexPath *)indexPath {

     if (editingStyle == UITableViewCellEditingStyleDelete) {

         // Delete the row from the data source
         [appDelegate.banks removeObjectAtIndex:indexPath.row];

         [banksTableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationRight];

         [banksTableView reloadData];
     } 
} 

//// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
    NSString *temp = [appDelegate.banks objectAtIndex:fromIndexPath.row];
    [appDelegate.banks removeObjectAtIndex:fromIndexPath.row];
    [appDelegate.banks insertObject:temp atIndex:toIndexPath.row];
} 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:18:33+00:00Added an answer on May 23, 2026 at 10:18 am

    Actually you have added an extra colon(":") in the commitEditingStyle: method name. Adding the extra colon has made this method a completely different method. So, your view controller thought that you haven’t implemented the commitEditingStyle: method and didn’t do anything while you edit your table view.

    Just remove the colon(":") after editingStyle in the commitEditingStyle: method. That will fix the problem. That line should look like this,

    - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle) editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build a C++ extension for python using swig. I've followed the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.