iPhone how to setup new design, mutli XIBs or?
开发者_C百科I am converting (trying to and learning at the same time) a Android Java app to iPhone. I have made test scenarios for most of the sections to make sure I have an idea how to proceed and I am getting close to actually starting.
The app starts on a main menu and from there goes to multiple sub menus (about 8 of them). Most of the sub menus goes to a single screen that performs an action, like data display or editing.
I have started the prototype with a Nav Controller and all the views on one XIB. Now the question is do I create another XIB for each of the sub menus and each of those would have views, or what? I have yet to find one article that explains the memory management and what the recommended way to do this is.
Thanks for any ideas and thoughts!
The reason you separate different sections into multiple XIB files is twofold:
- If the user doesn't go to each section of your app (they only select the first submenu, for example), only the needed XIB files have to loaded, reducing the memory footprint of your application. This generally isn't too much of an issue, unless you have a lot of things in your XIB, but it's always better to use memory sparingly because you don't know the users situation.
- When everything is split up into different files, you can potentially organize it better. This part is completely up to you, and whether you like to have everything in one place, or broken up into categories.
Basically, it doesn't matter too much for most applications which direction you go. Do whatever works for you. It is generally recommended to split the views used by view controllers out into different files (Xcode does this automatically a lot of the time). The view controllers do the lazy-loading of the additional XIB files for you (you just have to set the NIB Name
of the view controller), so it doesn't take much effort at all.
精彩评论