闲来无事,便随便记录写东西。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];
网友评论