UIViewController Present
Próbuję przedstawićUIViewController
zUIView
na tym.
Oto kod, który próbuję w moimviewDidLoad
metoda.
//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];
Po uruchomieniu aplikacji pojawia się następujący błąd.
Warning: Attempt to present <UIViewController: 0x751fcd0> on <ViewController: 0x751d7a0> whose view is not in the window hierarchy!
Co to oznacza i gdzie się mylę? Czy nie powinien wyświetlać białego widoku, czy rozumiem źle?
Dzięki.