title: iOS 7 error Warning: Attempt to dismiss from view controller <UINavigationController: 0x1568db40> while a presentation or dismiss is in progress
body: <p>I have issue in iOS 7 that does not appear in iOS 6.</p>
  
  <p>I have a navigation controller that is displaying another navigation controller to add an employee.  This second controller is being presented modally.  When I dismiss the second controller either with a "Cancel" or "Done" button, I get an error.  Here is the error:</p>
  
  <blockquote>
    <p>QuickSchedule[880:60b] Warning: Attempt to dismiss from view
    controller  while a presentation
    or dismiss is in progress!</p>
  </blockquote>
  
  <p>I am using an unwind segue and dismissing from the first controller using the following relevant code.</p>
  
  <p>This is in ScheduleViewController.m  (My main controller window)</p>
  
  <pre><code>- (IBAction)done:(UIStoryboardSegue *)segue
  {
      if ([[segue identifier] isEqualToString:@"DoneEditing"]) {
          [[MyManager sharedManager] saveChanges];
          [self dismissViewControllerAnimated:YES completion:NULL];
      }
  }
  </code></pre>
  
  <p>The connection in the connection inspector for the "Done" button is simply
  "action -> [unwind done:]"</p>
  
  <p>I had no errors before upgrading to Xcode 5.  This all started after upgrading Xcode and my storyboard to iOS 7.</p>
  
  <p>I am getting same error in different spot in my app, but again, it's with a modally presented view controller.</p>
  
  <p>I go from EmployeeViewController to AddEmployeeViewController modally.  I get the error again when I return from AddEmployeeViewController.</p>
  
  <p>EmployeeViewController.m</p>
  
  <pre><code>- (IBAction)done:(UIStoryboardSegue *)segue
  {
      if ([[segue identifier] isEqualToString:@"ReturnInput"]) {
          AddEmployeeViewController *addController = [segue sourceViewController];
          if (addController.employee) {
              [[MyManager sharedManager] saveChanges];
              [[self tableView] reloadData];
          }
          if (![self.presentedViewController isBeingDismissed]) {
              [self dismissViewControllerAnimated:YES completion:nil];
          }
      }
  }
  
  - (IBAction)cancel:(UIStoryboardSegue *)segue
  {
      if ([[segue identifier] isEqualToString:@"CancelInput"]) {
          [self dismissViewControllerAnimated:YES completion:NULL];
      }
  }
  </code></pre>
  
  <p>Here is AddEmployeeViewController.m</p>
  
  <pre><code>- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
      if ([[segue identifier] isEqualToString:@"ReturnInput"]) {
          if ([self.firstNameField.text length] || [self.lastNameField.text length]) {
  
              Employee *newEmployee = [[MyManager sharedManager] createEmployeeWithFirstName:self.firstNameField.text andLastName:self.lastNameField.text];
              [[MyManager sharedManager] addEmployeeToList:newEmployee];
              self.employee = newEmployee;
          }
      }
  }
  </code></pre>
  
  <p>I am still learning, and I have looked for hours online and cannot find an answer to this. I have tried putting the "saving code" in a completion block. I put it back and tried using nil instead of NULL in the completion block argument. As you can see, I have nil in one spot on a completion block argument and NULL on another.  No matter what, the error keeps appearing.</p>
  
  <p>Everything works as far a functionality, I just get this error logged to the console.  Any help is greatly appreciated.</p>
  
  <p>Note:
  I do not get this error with regular pushed navigation controllers.  This is only happening on dismissing modally presented view controllers.</p>