title: UITableViewController NavigationItem button issues
body: <p>I'm having issues in setting navigation buttons on my UITableViewController! this controller is inside a UINavigationController.</p>
  
  <p>I've following view controller:</p>
  
  <pre><code>@interface SettingsViewController : UITableViewController&lt;UITextFieldDelegate, UINavigationControllerDelegate&gt; {
  
     }
  ...........
  
  @end
  </code></pre>
  
  <p>and in implementation file:</p>
  
  <pre><code>- (void)viewDidLoad 
       {
            self.navigationItem.rightBarButtonItem = self.editButtonItem;
       }
  </code></pre>
  
  <p>I'm adding navigation button items programmatically.</p>
  
  <p>edit:</p>
  
  <pre><code>- (void)setEditing:(BOOL)editing animated:(BOOL)animated {
  
      [super setEditing:editing animated:animated];
      //[self.navigationItem setHidesBackButton:editing animated:YES];
  
      if (!editing) 
      {
       self.navigationItem.leftBarButtonItem = nil;
          [self save];
      }
      else 
      {
          UIBarButtonItem *cancelButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(Cancel:)];
          self.navigationItem.leftBarButtonItem = cancelButtonItem;
          cancelButtonItem = nil;
      }
  }
  </code></pre>
  
  <p>-- above edit function seems to be working fine in terms of setting navigation buttons</p>
  
  <p>cancel:</p>
  
  <pre><code>- (IBAction)Cancel:(id)sender {
      //cancel
      self.navigationItem.rightBarButtonItem = self.editButtonItem; --&gt; this is not setting edit button.
      self.navigationItem.leftBarButtonItem = nil;
  }
  </code></pre>
  
  <p>-- but clicking on cancel is not replacing navigationitem right-barbutton 'Done' with 'Edit' even though I'm doing this in Cancel method as shown above.</p>
  
  <p>whats wrong with this code?</p>
  
  <p>when I debug, I can't see following in debug area:</p>
  
  <p>po self.navigationItem</p>
  
  <p>any idea why?</p>
  
  <p>Thanks in advance,</p>
  
  <p>Rama</p>