PDA

View Full Version : How to improve application running?




Sergio10
Nov 8, 2009, 04:02 PM
Hi,

How to improve application running? When I run application it hangs about 2 seconds and then appears the view. I created standard "Window Based Application".

I saw many applications which appears immediately like this:
http://itunes.apple.com/us/app/airline-conqueror-usa/id333212995?mt=8

Thank you.



North Bronson
Nov 8, 2009, 05:36 PM
Hi,

How to improve application running? When I run application it hangs about 2 seconds and then appears the view. I created standard "Window Based Application".

I saw many applications which appears immediately like this:
http://itunes.apple.com/us/app/airline-conqueror-usa/id333212995?mt=8

Thank you.

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?

Sergio10
Nov 8, 2009, 07:00 PM
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?

Troglodyte
Nov 9, 2009, 02:58 AM
I'm gonna merge them to one big xib.

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).

Sergio10
Nov 9, 2009, 03:43 PM
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?

dejo
Nov 9, 2009, 04:19 PM
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?
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.