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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:16:31+00:00 2026-05-20T21:16:31+00:00

i am placing a toolbar at the top of my view with edit button.

  • 0

i am placing a toolbar at the top of my view with edit button.

For edit button i am giving action like edit the table as shown below.

- (IBAction)editModeForTable {
    [tableview setEditing:YES animated:YES];
    NSLog(@"edit button clicked ");
}

Now what i need is when i click on edit button i need to change this edit button to done button.

myscreen

this is myscreen.

when ever i click on edit i need to set edit mode for table and change edit button to done.

similarly when ever i click on done button i need to change that done to edit button and edit mode should be false.

Update:

- (IBAction)editModeForTable {
    if (buttonClickid == 1) {
        [allLIsts setEditing:YES animated:YES];
        mybutton.style = UIBarButtonSystemItemDone;
        mybutton.title = @"Done";
        buttonClickid = 2;
        NSLog(@"mmm");
    }
    if (buttonClickid == 2) {
        [allLIsts setEditing:NO animated:YES];
        mybutton.style = UIBarButtonSystemItemEdit;
        mybutton.title = @"Edit";
        buttonClickid = 1;
        NSLog(@"ppp");
    }


    NSLog(@"edit button clicked ");

}

this is button action where buttonclickid is int.

it executes both conditions why?

  • 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-20T21:16:32+00:00Added an answer on May 20, 2026 at 9:16 pm
    [btn setStyle:UIBarButtonItemStyleDone];
    [btn setTitle:@"Done"];
    

    Similiar to revert back.
    btn is an IBOutlet connected to the button in Interface Builder, or your created UIBarButtonItem.

    Your if logic is broken.

    - (IBAction)editModeForTable {
        if (![allLIsts isEditing]) {
            [allLIsts setEditing:YES animated:YES];
            mybutton.style = UIBarButtonSystemItemDone;
            mybutton.title = @"Done";
            NSLog(@"mmm");
        }
        else  {
            [allLIsts setEditing:NO animated:YES];
            mybutton.style = UIBarButtonSystemItemEdit;
            mybutton.title = @"Edit";
            NSLog(@"ppp");
        }
    
    
        NSLog(@"edit button clicked ");
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Spring MVC when placing an object in the view model like so: public
I have a jQuery UI Button that I'm placing in a jqGrid toolbar but
I am placing a JS file to remote server(s). I d like to know
I'd like to display a toolbar above a UIWebView but hide the toolbar until
I'm placing content on my page through an ajax (post) request like so: $("input#ViewMore").click(function()
Actually i am placing a bar button on right side of navigation bar, it's
I am placing a transition on the margin-top of an element, and I have
I'm placing an ImageButton on top of a MapView . The ImageButton is a
I'm placing a big image on top of a couple div layers with relative
I am having a problem placing a tool bar in the root view controller

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.