UIViewController Presente
Estoy tratando de presentar unUIViewController
con unUIView
en eso.
El siguiente es el código que estoy probando en miviewDidLoad
método.
//create the view controller
UIViewController *controller = [[UIViewController alloc] init];
UIView *view = [[UIView alloc] init];
view.backgroundColor = [UIColor whiteColor];
controller.view = view;
//show the view
[self presentViewController:controller animated:YES completion:nil];
Cuando ejecuto la aplicación, me está dando el siguiente error.
Warning: Attempt to present <UIViewController: 0x751fcd0> on <ViewController: 0x751d7a0> whose view is not in the window hierarchy!
¿Qué significa esto y dónde me voy mal? ¿No debería mostrar una vista en blanco o estoy entendiendo mal?
Gracias.