我想从一个按钮推视图。该方法在点击时被调用,但视图不会被推入导航控制器。下面是按钮点击代码:查看不会按下按钮单击 - Iphone dev
- (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];
}
}
我所试图做的是,我有,当我登录到我的应用程序,选项观点似乎它有按钮。每个按钮都必须推入一个视图。下面是在ViewController.m文件中调用optionsView的代码:
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;
请告诉我我在做什么错?
在AppDelegate * delegate =(AppDelegate *)[[UIApplication sharedApplication] delegate]' – pbibergal