0

我有一个简单的场景:一个带有多个嵌入 UITableViewControllers 的 UINavigationController。
每个 UITableViewController 都有一个提示集,除了 ROOT UITableViewController(没有提示)。
并且在每个 UITableViewController 中,都有一个 UIBarButtonItem 可以返回到 ROOT UITableViewController:

- (void) backHome {
  [[self navigationController] popToRootViewControllerAnimated: YES];
}

它实际上回到了 ROOT UITableViewController,但它保留了最后一个 UITableViewController 的提示,同时它假设删除它(知道 ROOT UITableViewController 没有提示)。
但是当我使用并多次使用代码点击自定义 UIBarButtonItem 时:

- (void) back {
  [[self navigationController] popViewControllerAnimated: YES];
}

它按预期删除提示。

为什么 popToRootViewControllerAnimated 不删除提示?尤其是在 iOS 8.x 中。因为它在 iOS 7.1.2 中工作,
所以我使用最新的 Base SDK 8.1

4

2 回答 2

0

尝试调用堆栈上的属性

[self.navigationController popToRootViewControllerAnimated: YES];
于 2014-11-20T07:52:18.820 回答
0

我有一个类似的问题,可以确认它仍然存在于当前的 Xcode 和模拟器中。除了最后一个之外,我在导航控制器中的所有视图控制器上都有提示。

在没有动画的情况下弹出到根目录对我有用并再次显示提示,否则不会显示。

于 2016-04-13T03:14:26.053 回答