美文网首页
UINavigationController pop&push

UINavigationController pop&push

作者: 碳酸补钙专家 | 来源:发表于2017-10-25 20:46 被阅读0次

UINavigationController先pop再push,push操作将无效。

解决方案是:

OrderDetailViewController *vc = [[OrderDetailViewController alloc] init];

NSMutableArray *arrView = [NSMutableArray arrayWithArray:self.navigationController.viewControllers];

int index = (int)[arrView indexOfObject:self];

[arrView removeObjectAtIndex:index];

[arrView addObject:vc];

[self.navigationController setViewControllers:arrView animated:NO];

相关文章

网友评论

      本文标题:UINavigationController pop&push

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