How can I improve the startup time of my app?
Why iPhone app's splash screen takes more time fo开发者_C百科r loading?
Can we set the time for few second only? it takes almost one minute at the moment.
Well the splash screen is shown as long as your app is starting, meaning not returning from the - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
method.
If you are doing a lot of thing in this method then you should spilt up that code to do then at an other point in the start up of your app.
You should keep the startup time of your app as short as possible, start maintance code in separate thread, try lazy loading for every thing else.
The splash screen stays up until your app finishes initialising. Either speed up your initialisation code, or move the slow bits into a background task.
Are you timing this while in XCode? If you are then don't - XCode has to attach debuggers and all sorts of things before the app starts up.
To get a real time, build a release version and put it on a device. Then disconnect the device and start your app. that should give you a real-world indication of how long it will take.
精彩评论