nested push animation can result in corrupted navigation bar multiple warning

前端 未结 2 661
一整个雨季
一整个雨季 2021-01-15 09:02

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

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-15 09:22

    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

提交回复
热议问题