美文网首页
跳转(pop)到指定界面

跳转(pop)到指定界面

作者: 剪刀_石头_布 | 来源:发表于2017-04-14 15:30 被阅读30次

    闲来无事,便随便记录写东西。iOS中pop到任意指定界面的方法有两种:

    一、    

    for (UIViewController *controller in self.navigationController.viewControllers) {

              if ([controller isKindOfClass:[YouController class]]) {

                       YouController  *youVC = [[YouController alloc] init];

                       [self.navigationController popToViewController:youVC animated:YES];

              }

     }

    二、

    UIViewController *controller = self.navigationController.viewControllers[需要跳转的界面,此处填数字];

    [self.navigationController popToViewController:controller animated:YES];

    相关文章

      网友评论

          本文标题:跳转(pop)到指定界面

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