调用的代码
- C/C++ code
[self loadViewByLoginCondition]; [self.window addSubview:navigationController.view]; [self.window makeKeyAndVisible]; return YES;
函数的代码:
- C/C++ code
- (void)loadViewByLoginCondition{ if (![NSString isNullOrEmpty:self.tokenKey] && ![NSString isNullOrEmpty:self.tokenSecret]) { PublishContentController *publishContentController = [[PublishContentController alloc] initWithNibName:@"PublishContentController" bundle:nil]; self.viewController = publishContentController; } else{ WeiboWebviewController *authController = [[WeiboWebviewController alloc] initWithNibName:@"WeiboWebviewController" bundle:nil]; self.viewController = authController; } [navigationController initWithRootViewController:self.viewController];}
设置这个root view controller不管用。怎么回事?
------解决方案--------------------
你好~
把 “self”去掉看看~
------解决方案--------------------
[self.navigationController pushViewController:self.viewController];
------解决方案--------------------
navigationController中的各个视图并不是add上去的.是一个一个推进去的.
比如你当前有个tableView其中自然就带了一个navigationController
想要添加的下级视图名字叫myViewController就这样写
- C/C++ code
[self.navigationController pushViewController:self.myViewController animated:YES];