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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:34:17+00:00 2026-06-06T00:34:17+00:00

How can I impose additional behavior when in the edit mode of a table

  • 0

How can I impose additional behavior when in the edit mode of a table view controller. I want to implement a behavior just like the Recents section of Phone application where once Edit is pressed a Clear button appears on the left. How can I do this?

In viewDidLoad I have

self.navigationItem.rightBarButtonItem = self.editButtonItem;

And therefore when Edit button is pressed I get the red circles that gives me the deleting capability which works fine and then

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath

is called automatically so the tableview and the underlying data is updated. They all work fine. But if I modify the content of viewDidLoad like the following

self.navigationItem.rightBarButtonItem = self.editButtonItem;
self.navigationItem.rightBarButtonItem.action = @selector(editPressed:); 

and implement

- (IBAction)editPressed:(UIButton *)sender
{
    NSLog(@"In Edit Pressed");
}

Pressing Edit button will take me to editPressed: but now the normal behavior of Edit for tableview is lost.

  • 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-06-06T00:34:18+00:00Added an answer on June 6, 2026 at 12:34 am

    When using the default view controller edit button, you can override the method - (void)setEditing:(BOOL)editing animated:(BOOL)animated of the UITableViewController. So, you can put the code in this method, and super it. So, your code could look like this:

    - (void)setEditing:(BOOL)editing animated:(BOOL)animated
    {
        [super setEditing:editing animated:animated];
    
        if (myTable.editing)
            self.navigationItem.leftBarButtonItem = additionalButtonItem;
        else
            self.navigationItem.leftBarButtonItem = nil;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a view that design view like : Here i impose some entry
Can this be done? It seems like this should be possible. In general, I
How can I impose GdkDrawingArea on the GtkImage for painting on an image, for
Can we impose procssor affinity in OpenCl? For example thread# 1 executes on procesor#
Is there any way I can impose a size constraint on a character buffer
How can I impose matrix equality term by term in a simplifying assumptions in
I know I can view certain counters such as memory usage but can I
I want to implement an alternative method for logging in (for @mother_company.xyz type e-mails)
Are computer languages copyrighted or have some restrictions imposed on them how they can
can anyone help me in trying to check whether JavaScript is enabled in client

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.