Custom Segue

Discussion in 'iPhone/iPad Programming' started by nashyo, Aug 4, 2012.

  1. macrumors 6502

    nashyo

    Joined:
    Oct 1, 2010
    Location:
    Bristol
    #1
    I'm trying to set up a custom segue, but I am getting a strange error message.

    I have two scenes connected in storyboard with 'custom' connection. I have subclassed UIStoryboard segue and I have input the class name and segue identifier into storyboard.

    The first scene is a tableview and it's delegate calls performseguewithidentifier.

    UIStoryboardSegue Subclass
    Code:
    -(void)perform
    {
        __block UIViewController *sourceViewController = (UIViewController*) [self sourceViewController];
        __block UIViewController *destinationViewController = (UIViewController*) [self destinationViewController];
        
        [UIView transitionWithView:sourceViewController.navigationController.view
                          duration:.5
                           options:UIViewAnimationOptionTransitionFlipFromBottom
                        animations:^{
                            [sourceViewController.navigationController presentModalViewController:destinationViewController animated:NO];
                        }
                        completion:^(BOOL finished) {
                            NSLog(@"Transition Completed");
                        }];
    }
    Error
    "Application tried to present modally an active controller"

    What does this mean? And why hasn't it worked?

    Thanks
     

Share This Page