how to load another nib file from viewbased application.
I added button in root nib file.... on clicking button i need to load another nib file.
how to load another nib file from viewbased application.
I added button in root nib file.... on clicking button i need to load another nib file.
In app delegate use this
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
// Add the view controller's view to the window and display.
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
[window addSubview:navigationController.view];
[window makeKeyAndVisible];
return YES;
}
and
In controller class use:
-(IBAction)buttonClick:(id)sender{
SecondViewController *_secondView = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
[self.navigationController pushViewController:_secondView animated:YES];
}
It will works fine..... enjoy
Thanks people.