【发布时间】:2010-02-09 17:39:04
【问题描述】:
我有一个UINavigationViewController,在其中我添加了一个UITableViewController 作为子视图。
我希望能够从 UITableViewController 内部告诉 UINavigationViewController pushViewController,但我无法检索正确的 navigationController 对象。
我已经尝试了in this thread 讨论的一些方法,但我无法获取视图的 navigationController。
有没有办法为子视图的“拥有”视图获取参考?
编辑:我能够做到这一点:
[[(MyAppDelegate *)[[UIApplication sharedApplication] delegate] mainViewController].navigationController pushViewController:oOptionsViewController animated:YES];
让它发挥作用。但问题只是我想在不一定知道navigationController的具体名称的情况下这样做(假设我有几个这样的实例,我使用相同的类,但它们可能用于其他导航控制器..)
【问题讨论】:
标签: uinavigationcontroller uitableview