我正在尝试从按钮推送视图。该方法在点击时被调用,但视图不会被推送到导航控制器中。下面是按钮点击的代码:
- (IBAction)aboutButtonTapped:(id)sender {
NSLog(@"dashBoardButtonTapped");
if (self.aboutView == nil) {
self.aboutView = [[About alloc] initWithNibName:@"About" bundle:nil];
[self.navigationController pushViewController:self.aboutView animated:YES];
}
else {
[self.navigationController pushViewController:self.aboutView animated:YES];
}
}
我想要做的是,当我登录到我的应用程序时,会出现一个带有按钮的选项视图。每个按钮都必须在视图中按下。下面是调用 optionsView 的 ViewController.m 文件中的代码:
self.optionsView = [[Options alloc] initWithNibName:@"Options" bundle:nil];
self.navigationController = [[UINavigationController alloc] initWithRootViewController:self.optionsView];
AppDelegate *delegate = [[UIApplication sharedApplication] delegate];
delegate.window.rootViewController = self.navigationController;
请告诉我我在这做错了什么?