views:

112

answers:

1

I have an iphone application which is having a UIWindow. I want to add more UIViews to that. I tried this.

SettingsViewController *viewctrl = [[SettingsViewController alloc] initWithNibName:@"SettingsViewController" bundle:nil];
[self.navigationController pushViewController:viewctrl animated:YES];
[viewctrl release];

But it didnt worked. Anybody please help me. Thanks in advance.

A: 

You need to show more code.
self.navigationController is nil by default if you didn't setup a navigation controller.

CiNN
When my application launches, My MainWindow.xib loads. I want to navigate a uiviewcontroller when i clicked on UIBarButtonItem. So am calling a function - (IBAction) SettingsPressed: (id) sender{}. I have added IBOutlet UINavigationController *navigationController;@property (nonatomic, retain) UINavigationController *navigationController;in my Appdelegate.h - (IBAction) SettingsPressed: (id) sender{......}This function is written above
Sijo