I have an aplication with the delegate, the controller and some other things. The thing is that i initzialize everything in the controller with init. This init creates 3 UIVIews
Assuming that all of your views are part of a single screen, you don't need to add anything to your window after setting it up with your viewController. Set your viewController and then just add the next views on that controller's view.
e.g. in your AppDelegate
:
[self.window addSubview:self.viewController.view];
[self.window makeKeyAndVisible];
And then in your ViewController
:
- (void)viewDidLoad {
[super viewDidLoad];
// blah blah blah
[self.view addSubview:imagePickerController.view];
[self.view addSubview:self.glView];
[self.view addSubview:mapView];
}
Note that init
methods are usually used to initialize values, and viewDidLoad
is usually used to set up views.