views:

261

answers:

2

Dear All,

[I just posted a similar question, but I'm not sure whether is actually got posted. Editor: please remove if this is a double post.]

The app that I'm writing has quite some code in the appdelegate's "applicationDidFinishLaunching" and a ViewController's "viewDidLoad". All of this code is executed before the user can start doing something with the app. In the mean time, the "default.png" is shown as a splash screen. This can take up to 10 seconds, which is I think unacceptably long. So I want some of the code to be executed, when the actual UI is already visible and accessible to the user. I don't want however that the user him/herself needs to push a refresh/continue button. Could anyone suggest me a way to minimize the startup time, and do this kind of post-poned execution? Thanks is advance, Sjakelien

+2  A: 

You can use NSObject's performSelector:withObject:afterDelay: from your applicationDidFinishLaunching to postpone part of your initialization.

Nikolai Ruhe
I think this is indeed exactly what I am looking for. Thank you so much! (Just found out that the delay -quite likely- is in seconds, not milliseconds)
Sjakelien
+1  A: 

Perhaps you can use the viewDidFinishLoad delegate, but I'm not sure if it's still loaded within the "default image time" or afterwards.

Enyra