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 6013999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:37:43+00:00 2026-05-23T02:37:43+00:00

In my app I need to delete multiple rows in a table, edit the

  • 0

In my app I need to delete multiple rows in a table, edit the table and get a check box beside the table. When checked then the table cells are deleted. It is like the iPhone message app. How can I do this, please help me.

  • 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-23T02:37:44+00:00Added an answer on May 23, 2026 at 2:37 am

    If I understand your question correctly, you essentially want to mark UITableViewCells in some way (a checkmark); then, when the user taps a master “Delete” button, all marked UITableViewCells are deleted from the UITableView along with their corresponding data source objects.

    To implement the checkmark portion, you might consider toggling between UITableViewCellAccessoryCheckmark and UITableViewCellAccessoryNone for the UITableViewCell‘s accessory property. Handle touches in the following UITableViewController delegate method:

    - (void)tableView:(UITableView *)tableView
      didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
        UITableViewCell *c = [tableView cellForRowAtIndexPath:indexPath];
        if (c.accessoryType == UITableViewCellAccessoryCheckmark) {
            [c setAccessoryType:UITableViewCellAccessoryNone];
        }
        //else do the opposite
    
    }
    

    You might also look at this post regarding custom UITableViewCells if you’re wanting a more complex checkmark.

    You can set up a master “Delete” button two ways:

    • The IB approach
    • The programmatic approach

    In either case, eventually a method must be called when the master “Delete” button is pressed. That method just needs to loop through the UITableViewCells in the UITableView and determined which ones are marked. If marked, delete them. Assuming just one section:

    NSMutableArray *cellIndicesToBeDeleted = [[NSMutableArray alloc] init];
    for (int i = 0; i < [tableView numberOfRowsInSection:0]; i++) {
        NSIndexPath *p = [NSIndexPath indexPathWithIndex:i];
        if ([[tableView cellForRowAtIndexPath:p] accessoryType] == 
            UITableViewCellAccessoryCheckmark) {
            [cellIndicesToBeDeleted addObject:p];
            /*
                perform deletion on data source
                object here with i as the index
                for whatever array-like structure
                you're using to house the data 
                objects behind your UITableViewCells
            */
        }
    }
    [tableView deleteRowsAtIndexPaths:cellIndicesToBeDeleted
                     withRowAnimation:UITableViewRowAnimationLeft];
    [cellIndicesToBeDeleted release];
    

    Assuming by “edit” you mean “delete a single UITableViewCell” or “move a single UITableViewCell,” you can implement the following methods in the UITableViewController:

    - (void)viewDidLoad {
        [super viewDidLoad];
    
        // This line gives you the Edit button that automatically comes with a UITableView
        // You'll need to make sure you are showing the UINavigationBar for this button to appear
        // Of course, you could use other buttons/@selectors to handle this too
        self.navigationItem.rightBarButtonItem = self.editButtonItem;
    
    }
    
    // Override to support conditional editing of the table view.
    - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
        // Return NO if you do not want the specified item to be editable.
        return YES;
    }
    
    - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
        return YES;
    }
    
    - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    
        if (editingStyle == UITableViewCellEditingStyleDelete) {
            //perform similar delete action as above but for one cell
        }   
    }
    
    - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
        //handle movement of UITableViewCells here
        //UITableView cells don't just swap places; one moves directly to an index, others shift by 1 position. 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is Windows Phone 7 app using SQL CE database. I need to delete
I need to delete an application (MyApp.app), which has read only permissions in all
I need to delete some information from Google app engine datastore (not google app-engine
I need to programmatically add and remove rows from a Word 2010 table. Unfortunately
i am develop an web app and in the authentication i need to delete
In my app i need to save changed values (old and new) when model
In my app users need to be able to enter numeric values with decimal
For my GAE app I need to do some natural language processing to extract
In my app I need to draw a widget contents onto Bitmap. The code(pseudo)
I'm building a app that need manage money datatype. I'm new on Obj-c, so

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.