关于NavigationController的一个问题。
以下是我的AppDelegate.m代码
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
MenuViewController *leftVC = [[MenuViewController alloc] init];
StatusViewController *plainVC = [[StatusViewController alloc] init];
ICSDrawerController *drawer = [[ICSDrawerController alloc] initWithLeftViewController: leftVC centerViewController: plainVC];
self.window.rootViewController = drawer;
navController = [[UINavigationController alloc] initWithRootViewController: drawer];
[self.window makeKeyAndVisible];
return YES;
}
其中,ICSDrawerController
中包括两个成员MenuViewController
和StatusController
。在StatusController.m
中,我想令其在触发按钮后跳转进入另外一个界面,部分代码如下:
- (IBAction) startToRunning: (id)sender {
NSLog (@"hello");
RunningViewController *RVC = [[RunningViewController alloc] init];
[self.navigationController pushViewController: RVC animated: true];
NSLog(@"%@", self.navigationController);
}
在实测中的console输出:
2016-01-18 11:00:18.043 SunnySports[11582:1035035] hello
2016-01-18 11:00:18.043 SunnySports[11582:1035035] <UINavigationController: 0x7fc71181da00>
但是,界面却无法跳转。求助!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
self.window.rootViewController = drawer;
这句话改为
self.window.rootViewController = navController
并且写在 [self.window makeKeyAndVisible]; 的上面试试