title: how to change barbuttonitem from edit to done
body: <p>i am placing a toolbar at the top of my view with edit button.</p>
  
  <p>For edit button i am giving action like edit the table as shown below.</p>
  
  <pre><code>- (IBAction)editModeForTable {
      [tableview setEditing:YES animated:YES];
      NSLog(@"edit button clicked ");
  }
  </code></pre>
  
  <p>Now what i need is when i click on edit button i need to change this edit button to done button.</p>
  
  <p><img src="https://i.stack.imgur.com/YhLPJ.png" alt="myscreen"> </p>
  
  <p>this is myscreen.</p>
  
  <p>when ever i click on edit i need to set edit mode for table and change edit button to done.</p>
  
  <p>similarly when ever i click on done button i need to change that done to edit button and edit mode should be false.</p>
  
  <p><strong>Update:</strong></p>
  
  <pre><code>- (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 ");
  
  }
  </code></pre>
  
  <p>this is button action where buttonclickid is int.</p>
  
  <p>it executes both conditions why?</p>