title: Application tried to present modally an active controller?
body: <p>I am getting the error:</p>
  
  <pre><code>Application tried to present modally an active controller
  </code></pre>
  
  <p>when I attempt to run my code below.</p>
  
  <p>I am wanting to present a modal view-controller that is embedded within a <code>UINavigationController</code>. I have the <code>navigationVC</code> instantiated before this point. I only get this error when I run this code a second time. What I mean is that if I click a button and it runs this code it will work properly. I can than modally close that view. If I click the same button again to run it once more, I am getting  error.   </p>
  
  <pre><code>- (void)pushToUserProfile
  {
      if (!self.profileVC) {
          self.profileVC = [self.storyboard instantiateViewControllerWithIdentifier:@"profileVC"];
          [self.profileVC setCanEditProfile:NO];
          [self.profileVC setTitle:@"Profile"];
          [self.profileVC setCanCloseModal:YES];
      }
  
      [self.navigationVC setViewControllers:@[self.profileVC]];
  
      [self presentViewController:self.navigationVC animated:YES completion:nil];
  }
  </code></pre>
  
  <p>What am I doing wrong below?:</p>
  
  <p>edit:</p>
  
  <p>I also run the code:</p>
  
  <pre><code>- (void)writeComment
  {
      if (!self.writeCommentVC) {
          self.writeCommentVC = [self.storyboard instantiateViewControllerWithIdentifier:@"writeCommentVC"];
      }
  
      [self.navigationVC setViewControllers:@[self.writeCommentVC]];
  
      [self presentViewController:self.navigationVC animated:YES completion:nil];
  }
  </code></pre>
  
  <p>and it works with no issue. Not matter how many times I present/dismiss that view controller.</p>