![](/img/trans.png)
[英]UITableViewcontroller in UINavigationController ios
[英]UINavigationController with a UITableViewController
我UITableViewController
在名为EditPoint UINavigationController
是在一个呈现UIPopoverController
。
有时EditPoint是根UITableview,有时是另一个UITableviewContoller
推送EditPoint。
有没有一种方法可以在EditPoint TableViewController中告诉我另一个方法是否将其推入视图或它的根目录?
我按下EditPoint:
[self.navigationController pushViewController:tableView animated:TRUE];
然后在EditPoint中,我尝试了:
DLog(@"self.navigationController.presentingViewController: %@", self.navigationController.presentingViewController);
DLog(@"self.navigationController.presentedViewController: %@", self.navigationController.presentedViewController);
DLog(@"self.presentingViewController: %@", self.presentingViewController);
DLog(@"self.presentedViewController: %@", self.presentedViewController);
它们都返回NULL。
但是,如果我尝试:
[self.navigationController popToRootViewControllerAnimated:TRUE];
或其他任何弹出方法,都可以。
知道为什么我不能弄清楚presentingViewController
是什么吗?
最终结果是,我需要确定是否有一个后退按钮,或者是否需要在该按钮上显示“取消”。 有没有更好的办法解决这个问题?
使用self.navigationController.viewControllers来检查self是否是其nav控制器堆栈中的根视图控制器,当控制器以模式形式出现时,应使用您正在使用的属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.