Let’s say my application has 6 windows, 1 windows is main windows, and other 5 are for settings, scores, statistics etc.
So if I’m correct, multiple nibs are used because of memory managament?
So If I put all 6 views in one nib file, when loading application it will load all 6 views at the same time and take a lot of memory, but if I use 6 nibs for 6 views, on startup application will load only first view, and when I click in exammple “Options” then it will load Options.nib and diplay the view.
Are there more reasons to use multiple nibs instead of multiple views in one nib?
Am I right?
And how do I know when to use addSubview or presentModalViewController?
What is the main difference when I’m using those two methods to switch views?
You are right about memory. All the views of a nib are loaded simultaneously in memory. You may not need them at once. So in that case you are wasting memory. This can even crash the app if you have many views.
Adding separate nibs in general lead to more structured code. There is no logical relation between settings and score. So you should have separate classes and nibs for them. If you don’t do that, you may have an unmanageable code which will require more time in maintaining and modifying.