How to improve application running?

Discussion in 'iOS Programming' started by Sergio10, Nov 8, 2009.

  1. Sergio10 macrumors regular

    Oct 3, 2007
  2. North Bronson macrumors 6502

    Oct 31, 2007
    San José
    I think that a good way to start is to try loading all the resources lazy.

    Are you loading a lot of resources when the user launches the application? Could you wait longer to load these resources -- until the user actually chooses an option that requires the resource?
  3. Sergio10 thread starter macrumors regular

    Oct 3, 2007
    First view which appears doesn't have a lot of controls. At the beginning I will show some splash while first view is loading.
    For now my application is separated to many xib bundles. Each of them contains one view. Navigation between views is too slow. I'm gonna merge them to one big xib.
    Does it improve switching between views? What do you think?
  4. Troglodyte macrumors member

    Jul 2, 2009
    Don't. It increases the memory footprint and makes app start up slower. You should be aiming to just have what you need in memory at that time - load stuff as and when you need it and dump it when you're finished with it.

    You could try creating the views in code. I dunno but it's probably a bit quicker. I only use nibs when the UI is very complex (and it usually isn't - most of the time it's just a UITableView which is half a dozen lines of code to set up in code).
  5. Sergio10 thread starter macrumors regular

    Oct 3, 2007
    So, how to solve the problem? I have about 20 XIBs. User should use all of them in one time. I suggest to init them at the beginning.
    What do you think?
  6. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    I doubt they are able to access all 20 XIBs immediately. You probably are only showing one XIB upon startup, from one view controller, right? Then when the user does something that requires another view (and perhaps another view controller) you initialize that new view and then display it. If navigation between the views is too slow, you have something else funky going on. This is not an unusual approach and works well most of the time.

Share This Page