如何使用导航控制器中的按钮推送视图? 我试图按照这个例子: http://www.cimgf.com/2009/06/25/uitabbarcontroller-with-uinavigationcontroller-using-interface-builder/在UINavigationController中推送另一个视图?
这正是我需要的,我有一个UITabBarController
有4个选项卡,其中之一是UINavigationController
。我想从第一个视图推送包含导航控制器的视图 - 这是一个简单的UIView
。它不起作用,我也试着用程序创建的按钮,没有任何反应。任何指针?
下面的代码我有
@interface HomeViewController : UIViewController {
}
-(IBAction)pushViewController:(id)sender;
@end
---
#import "HomeViewController.h"
#import "NewViewController.h"
@implementation HomeViewController
-(IBAction)pushViewController:(id)sender {
NewViewController *controller = [[NewViewController alloc] initWithNibName:@"NewViewController" bundle:nil];
[[self navigationController] pushViewController:controller animated:YES];
[controller release], controller = nil;
}
这里也是与连接 http://imageshack.us/photo/my-images/847/screenshot20110719at620.png/
我试过什么你们建议,仍然一无所获,按钮(无论他们在创建截图Interface Builder
或以编程方式)表现得像他们没有链接到任何方法。
尝试张贴在这里你的代码,所以我们可以看到什么可能会错误。 –
你是否遵循了教程的每一步? “它不起作用”太抽象了,无法理解你的问题。请张贴一些代码。 – Mat