我有一个简单的场景:一个带有多个嵌入 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