title: Unable to create unwind segues when using custom view controller containment
body: <p>I'm attempting to convert our application to storyboards and have hit what I believe is a bug in the handling of unwind segues when dealing with custom container controllers. We have a view controller which displays another and uses the view controller containment api to do this, I wire up the segue in IB then select a custom class for the implementation.  The perform method looks something like this:</p>
  
  <pre><code>-(void) perform {
      UIViewController *container = [self sourceViewController];
      UIViewController *child = [self destinationViewController];
      [container addChildViewController:child];
      [container.view addSubview:child.view];
      child.view.center = container.view.center;
      [UIView transitionWithView:container.view
                        duration:0.35
                         options:UIViewAnimationOptionCurveEaseInOut
                      animations:^{
                          child.view.alpha = 1;
                      } completion:^(BOOL finished) {
                          [child didMoveToParentViewController:container];
                      }];
  }
  </code></pre>
  
  <p>That works perfectly,  however I can't make it perform the unwind segue back to the container controller.  I override viewControllerForUnwindSegueAction: fromViewController: withSender: and ensure that it's returning the correct value:</p>
  
  <pre><code>-(UIViewController *) viewControllerForUnwindSegueAction:(SEL)action fromViewController:(UIViewController *)fromViewController withSender:(id)sender {
      id default = [super viewControllerForUnwindSegueAction:action fromViewController:fromViewController withSender:sender];
      NSAssert1(default == self, @"Expected the default view controller to be self but was %@", default);
      return default;
  }
  </code></pre>
  
  <p>I can also confirm that canPerformUnwindSegueAction:fromViewController:withSender is being called and doing the right thing, but to be sure I overrode it to return YES</p>
  
  <pre><code>-(BOOL) canPerformUnwindSegueAction:(SEL)action fromViewController:(UIViewController *)fromViewController withSender:(id)sender {
      return YES;
  }
  </code></pre>
  
  <p>The next step I would expect to happen is for segueForUnwindingToViewController:fromViewController:identifier: to be called, however it never is.  Instead the application crashes with an NSInternalInconsistencyException.</p>
  
  <pre><code>2012-10-01 10:56:33.627 UnwindSegues[12770:c07] *** Assertion failure in -[UIStoryboardUnwindSegueTemplate _perform:], /SourceCache/UIKit_Sim/UIKit-2372/UIStoryboardUnwindSegueTemplate.m:78
  2012-10-01 10:56:33.628 UnwindSegues[12770:c07] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not find a view controller to execute unwinding for &lt;USCustomContainerViewController: 0x75949a0&gt;'
  *** First throw call stack:
  (0x1c8e012 0x10cbe7e 0x1c8de78 0xb61f35 0x581711 0x45ab54 0x10df705 0x16920 0x168b8 0xd7671 0xd7bcf 0xd6d38 0x4633f 0x46552 0x243aa 0x15cf8 0x1be9df9 0x1be9ad0 0x1c03bf5 0x1c03962 0x1c34bb6 0x1c33f44 0x1c33e1b 0x1be87e3 0x1be8668 0x1365c 0x1e7d 0x1da5)
  libc++abi.dylib: terminate called throwing an exception
  </code></pre>
  
  <p>Has anyone successfully used unwind segues combined with the view controller containment APIs?  Any idea what step I'm missing?  I've uploaded a <a href="https://github.com/NZKoz/UnwindSegues">demo project to github</a> which shows the issue in the simplest demonstration project I could come up with.</p>