【发布时间】:2010-03-19 23:15:16
【问题描述】:
我在目标 C 中的 ipod 应用程序上使用 xcode,并且我的一个类 (rootViewController) 中有一个字段 (navigationController)。如何从另一个类中引用实例化的 rootViewController 的 navigationController?例如,如果我想从 FirstViewController.m 类中引用 navigationController,我该怎么做?
我似乎只能找到这个引用应用程序委托的引用。
如果我想用 FirstViewController 引用应用程序委托,我只是说:
MyAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
[delegate.navigationController pushViewController:childController animated:YES];
如何为 rootViewController 类而不是 MyAppDelegate 执行此操作?
【问题讨论】:
标签: objective-c xcode navigationcontroller uiapplicationdelegate