Created
July 20, 2015 23:57
-
-
Save daniel-rueda/75fdf03443ac4a64cf0a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Crear un navigation controller usando un XIB | |
// Primero se debe crear el view controller inicial (root view controller) | |
// MyViewController cuenta con un archivo xib | |
MyViewController *viewController = [[MyViewController alloc] init]; | |
// Se crear el navigationController para presentar el viewController | |
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController]; | |
// Presentar el navigation controller (que ya incluye el view controller) | |
[self presentViewController:navigationController animated:YES completion:NULL]; | |
// Ahora ya es posible usar self.navigationController desde MyViewController (En el método viewDidLoad, por ejemplo) | |
// En MyViewController.m (ejemplo) | |
- (void)showButtonPresed:(id)button | |
{ | |
OtroViewController *otroController = [[OtroViewController alloc] init]; | |
[self.navigationController pushViewController:otroController animated:YES] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment