Specific application information: the application did not start on time (iOS)?

This is at the top of one of my crash reports. Is there any application timeout set by Apple? Any general workaround if so?

Elapsed total CPU time (seconds): 13.700 (user 8.580, system 5.120), 67% CPU Elapsed application CPU time (seconds): 6.180, 30% CPU 

On the iPhone 3G.

I need to split / delay my startup tasks, maybe ...

+4
source share
1 answer

I think it should start within 5 (or maybe 10) seconds or the iPhone suggests that it crashes.

Try not to load a lot of material into the main stream at startup. If you need to load a lot of material, do it in the background thread, for example:

 - (void)startLoading { //call this in your app delegate instead of setting window.rootViewController to your main view controller //you can show a UIActivityIndiocatorView here or something if you like [self performSelectorInBackground:@selector(loadInBackground)]; } - (void)loadInBackground { //do your loading here //this is in the background, so don't try to access any UI elements [self performSelectorOnMainThread:@selector(finishedLoading) withObject:nil waituntilDone:NO]; } - (void)finishedLoading { //back on the main thread now, it safe to show your view controller window.rootViewController = viewController; [window makeKeyAndVisible]; } 
+10
source

Source: https://habr.com/ru/post/952670/


All Articles