美文网首页
iOS Push到下级界面后再移除当前控制器

iOS Push到下级界面后再移除当前控制器

作者: JohnayXiao | 来源:发表于2020-03-28 15:29 被阅读0次
     NSMutableArray *marr = [[NSMutableArray alloc]initWithArray:self.navigationController.viewControllers];
        for (UIViewController *vc in marr) {
            if (vc == self) {
                [marr removeObject:vc];
                break;          //break一定要加,不加有时候有bug
            }
        }
        self.navigationController.viewControllers = marr;
    

    从当前界面进入下下级界面

     CreateQuNotiVController *vc1 = [[CreateQuNotiVController alloc] initQucikWithType:(TYCyclePagerCellTypeSMS) cache:NO];
                vc1.hidesBottomBarWhenPushed = YES;
                
                UIViewController *vc2 = [[NSClassFromString(@"GreetingCardViewController") alloc] init];
                vc2.hidesBottomBarWhenPushed = YES;
                
                [self.navigationController setViewControllers:@[self, vc2] animated:YES];
    

    相关文章

      网友评论

          本文标题:iOS Push到下级界面后再移除当前控制器

          本文链接:https://www.haomeiwen.com/subject/apxsuhtx.html