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

  • Home
  • SEARCH
  • 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 8624429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:31:37+00:00 2026-06-12T07:31:37+00:00

I added an Edit button to Navigation bar in my app. I have a

  • 0

I added an Edit button to Navigation bar in my app.

I have a UIViewController which implements UITableViewDataSource and UITableViewDelegate.

I added the UITableView using storyboards and made connections to data source and delegate.

I did like this in implementation file of the view controller:

self.navigationItem.rightBarButtonItem = self.editButtonItem;
[self.editButtonItem setAction:@selector(setEditing:animated:)];

and

- (void)setEditing:(BOOL)editing animated:(BOOL)animated
{
    DLog(@"Editing = %d", editing)
    NSLog(editing ? @"Yes" : @"No");

    [self.recentSearchList setEditing:editing animated:YES];
}

The problem is that whenever I tap on Edit button, the BOOL variable “editing” is always “YES”. And for the first it sets the UITableView to editing mode but the Edit button still shows “Edit” label instead of “Done”. And the since the parameter is always YES, the table view is never set to normal mode.

I read from an Answer in here: UITableView in edit mode – 'Edit' button doesn't change status

I am assuming the Edit button should change its state itself on tapping. And the parameter in the overridden method should also toggle.

I can write code of my own to set flags in the UIViewController to check the mode and toggle the tableView accordingly but I am assuming that there must be some other way.

  • 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-12T07:31:39+00:00Added an answer on June 12, 2026 at 7:31 am

    From the documentation

    enter image description here

    Also remove the line [self.editButtonItem setAction:@selector(setEditing:animated:)];

    The editButtonItem gets implicitly associated with the method - (void)setEditing:(BOOL)editing animated:(BOOL)animated.

    So you just gotta override that method and call super’s implementation at the top as the documentation says.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've added a button the my navigation bar like so: UIBarButtonItem *anotherButton = [[UIBarButtonItem
I have a UIViewController, and within that view i have UITableView added in IB
In my App I have an UIViewController, that pushed by another ViewController's navigation controller.
I have a segment control added to the navigation bar. It works fine. When
I have a UIViewController with a UITableView in it, and also added a UINavigationBar.
I have a piece of code: EDIT: The _penParams are initialized as the added
I've added my edit button self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemEdit target:self action:@selector(editNavButtonPressed)] autorelease]; But
I have used jQuery in my website. I have a navigation bar in my
I'm trying to disable a button that I add to my navigation controller bar.
I have a navigation view controller which navigates between some tableviews and I've just

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.