我对UITabBarController很新。我试图在viewController中提供与tabViewController中的选项卡相对应的导航系统
在viewDidLOad
中创建了一个导航控制器实例[testLabel setText:@"Test"];
self.navigator=[[UINavigationController alloc] initWithRootViewController:self];
[super viewDidLoad];
按下按钮我这样做
NSLog(@"I am here");
StartWordPickerVC *aStartWordPickerVC=[[StartWordPickerVC alloc] initWithNibName:@"StartWordPickerVC" bundle:nil];
[self.navigator pushViewController:aStartWordPickerVC animated:YES];
[aStartWordPickerVC release];
但是当我点击按钮时没有任何事情发生
你能帮帮我吗? 感谢
答案 0 :(得分:1)
只需在AppDelegate.h中添加
即可UINavigationController *navigationController;
只需在AppDelegate.m
中添加- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
self.window addSubview:navigationController.view];
[self.window makeKeyAndVisible];
}