If my app shuts down because load time takes to long, can I move some code in or being called from applicationDidFinishLaunching into the RootViewController? Meaning, is the (shutdown) timer only looking at applicationDidFinishLaunching?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m not 100% sure on this, but I believe the timer stops when control returns to the run loop and the application can accept user input, which is generally at the end of your applicationDidFinishLaunching method.
However, if you load a view in applicationDidFinishLaunching, and either your loadView or viewDidLoad takes a long time, you’re app may be shutdown by the OS. Alternatively, you can call the method using
-performSelector:withObject:afterDelay:with a delay of 0, and the method will be queued up in the run loop and run as soon as possible.If you must do a lot of processing before you can hand over control to the user, you should look into performing that load on a background thread.
EDIT: Here’s the relevant Technical Q&A.