开发者

iphone: need to implement navigationController inside viewcontroller which appears after selecting a tab in tabbar

I am pretty new to UITabBarController. I was trying to provide a navigation system in a viewController corresponding to a tab in tabViewController

created an instance of navigation c开发者_如何学运维ontroller in viewDidLOad

[testLabel setText:@"Test"];
self.navigator=[[UINavigationController alloc] initWithRootViewController:self];
[super viewDidLoad];

on button click I do this

NSLog(@"I am here");
StartWordPickerVC *aStartWordPickerVC=[[StartWordPickerVC alloc] initWithNibName:@"StartWordPickerVC" bundle:nil];
[self.navigator pushViewController:aStartWordPickerVC animated:YES];
[aStartWordPickerVC release];

But when I click button nothing happens

Can you please help me out in this Thanks


Just add this in AppDelegate.h

UINavigationController *navigationController;

Just add this in AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions   
{  
    navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];  
    self.window addSubview:navigationController.view];  
    [self.window makeKeyAndVisible];  
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜