iOS: When to use multiple NIB's or multiple views on same NIB?
Can anyone explain when it's better to use multiple views on the same NIB file than using multiple NIB files?
A NIB file can contain more than one view, so there should be times when it's better to use one method than the other.
Have i been too vague?
Best Reg开发者_Go百科ards Fak
Personally I think using one view per NIB is better because you can use the name of the NIB file to load it. It also makes it easier to deal with changes while your App is evolving and helps if multiple developer / creative designers are working on your App.
The only place where I could thing of a good reason to put multiple views into a single NIB is when the views belong together. An example would be multiple cells for a single table which are then selected by the data type of the row or the section they are used in.
The downside of having multiple views in one NIB is that you need to load the views manually when creating the View Controllers so I suggest only using a single View per NIB for view controllers.
精彩评论