2

I'm new in ios app developping and i'm having some trouble with multiple warnings.

I have a Navigation Controller that load a table view. From that table view one touch on a cell pushes a new VC (basically, the detail of the cell). And on that "detailView", when a certain button is pushed, another VC is pushed.

I push the last VC with the following code :

- (IBAction)toMoreDetail:(id)sender 
{
    [self performSegueWithIdentifier:@"toMoreDetail" sender:self];
}

And when i do that, 2 warnings are poping :

2012-08-05 02:25:41.842 appName[2145:f803] nested push animation can result in corrupted navigation bar
2012-08-05 02:25:42.197 appName[2145:f803] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.

I didn't find any good answer so far. Maybe anyone can help me with this problem.

Thanks :)

Edit : here is the code for the other segue :

From the TableList to the VC of detail (the segue start from the prototype cell and goes to the detail vc) :

- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([[segue identifier] isEqualToString:@"toDetailEvent"])
    {
        NSInteger selectedIndex = [[self.tableView indexPathForSelectedRow] row];
        DetailEvent* detailEvent = [segue destinationViewController];
        detailEvent.eventToDisplay = [listEvents objectAtIndex:selectedIndex];
    }
} 
3
  • 1
    it may be helpful if you post the code for prepareForSegue for the two segues.
    – danqing
    Commented Aug 5, 2012 at 3:23
  • 1
    I edited the post with the code of the other segue
    – Rom.
    Commented Aug 5, 2012 at 3:51
  • I have the same thing happening, mine is from a button and I am using storyboards. It seems like two view controllers are being called but I only have one link to view.
    – TIDev
    Commented Aug 27, 2012 at 20:50

2 Answers 2

17

My guess would be your button is linked with the segue, so when you add an IBAction on it, you trigger the segue twice.

If you go to your Storyboard and click on the segue, you should be able to see its origin and destination. Is its origin the entire view controller or just the button? You only need to manually performSegue if the origin is the entire view controller. Can you try comment out your [self performSegueWithIdentifier:@"toMoreDetail" sender:self]; stuff to see if it will work?

0
1

It seem that if you use a storyboard and hook up your segue from the source vc to the destination vc and call the segue using didSelectRow you can not leave an else statement for a segue choice: This works:

if ((indexPath.row == 0 && indexPath.section == 0)) {
    [self performSegueWithIdentifier:@"simpleLines" sender:self];
}
if ((indexPath.row == 0 && indexPath.section == 5)) {
    [self openAppStore];
}
if (indexPath.section == 4)  {
    [self performSegueWithIdentifier:@"pushSettingsVC" sender:self];
}

This does not work:

if ((indexPath.row == 0 && indexPath.section == 0)) {
    [self performSegueWithIdentifier:@"simpleLines" sender:self];
}
if ((indexPath.row == 0 && indexPath.section == 5)) {
    [self openAppStore];
}
else  {
    [self performSegueWithIdentifier:@"pushSettingsVC" sender:self];
}

You get a weird double push when using navigation controller. I do this every time I start a project and always forget why it happens. Next time I

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.