Hello,
The last couple of weeks I have been reading a lot of tutorials on how to design your application (regarding ViewControllers0 when starting to code on the iPhone.
Two different examples examples:
- Within your appDelegate define a RootViewController/MainViewController that instantiates all your other ViewControllers. All these ViewControllers are added to the window (MainWindow.xib). So this makes appDelegate and the MainWindow 'all-knowing' if it comes to the ViewControllers and their associated Views.
I would assume that this is really memory consuming.
- Instantiate your ViewControllers and their associated Views as you go. So your appDelegate and window (MainWindow) will only know 1 ViewController and that ViewController knows it's child and so on. For example:
LoginViewController --> CustomerViewController --> CreatedCustomerViewController etc.
I would assume that this is much more efficient.
My question is: What is the best way on going to programming and designing your application when choosing one of those examples? Or are there other and better ways?
Some tips would be much appreciated. Thanks in advance.
The last couple of weeks I have been reading a lot of tutorials on how to design your application (regarding ViewControllers0 when starting to code on the iPhone.
Two different examples examples:
- Within your appDelegate define a RootViewController/MainViewController that instantiates all your other ViewControllers. All these ViewControllers are added to the window (MainWindow.xib). So this makes appDelegate and the MainWindow 'all-knowing' if it comes to the ViewControllers and their associated Views.
I would assume that this is really memory consuming.
- Instantiate your ViewControllers and their associated Views as you go. So your appDelegate and window (MainWindow) will only know 1 ViewController and that ViewController knows it's child and so on. For example:
LoginViewController --> CustomerViewController --> CreatedCustomerViewController etc.
I would assume that this is much more efficient.
My question is: What is the best way on going to programming and designing your application when choosing one of those examples? Or are there other and better ways?
Some tips would be much appreciated. Thanks in advance.