title: xcode adding buttons to navigation bar
body: <p>I am making a simple app to display drink details, and now I am trying to add a view that allows the user to input their own drink. I already created a view to display the details, and now I am just passing the view into another controller to make the add drink view. Problem is, when I try to add a "cancel" and "save" button, it doesn't appear, although the code complies without any errors. I have attached code as reference. </p>
  
  <p>This is the code that makes the new view, when the add button is pressed. (I made an add button that works, and it pulls up the nav bar)</p>
  
  <pre><code>- (IBAction)addButtonPressed:(id)sender {
  
      AddDrinkViewController *addViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"DetailSecond"];
      UINavigationController *addNavController = [[UINavigationController alloc] initWithRootViewController:addViewController];
  
      [self presentModalViewController:addNavController animated:YES];
  
  
  
      NSLog(@"Add button pressed!");
  </code></pre>
  
  <p>This is the code from the addviewcontroller implementation file: </p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
  
      self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel:)];
  
      self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(save:)];
  
  }
  
  - (IBAction)save:(id)sender {
  
      NSLog(@"Save Pressed");
      [self dismissModalViewControllerAnimated:YES];
  
  }
  
  - (IBAction)cancel:(id)sender{
  
      NSLog(@"Cancel Pressed");
      [self dismissModalViewControllerAnimated:YES];
  }
  </code></pre>
  
  <p>I have imported the header from the addview into the root controller, so I don't think that is the problem, do any of you guys see anything that's wrong?</p>