Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

loon3y

macrumors 65816
Original poster
Oct 21, 2011
1,235
126
In the app I'm developing, we need the use of a router that has Local Connection only (no internet connection) just so that we can print easily with the built in air print feature.



The app stays at the splashscreen for 20 seconds, before the app is launched.

We have coding in DidFinishWithLaunchOptions, that initially fixed our main issue, which was that in the same circumstances (Connected with Wi-Fi that has no internet connection) it just crashed after 2 minutes on the splashscreen.


is there a more efficient way? right now it takes 20 seconds and i would like to reduce the time.
 
In the app I'm developing, we need the use of a router that has Local Connection only (no internet connection) just so that we can print easily with the built in air print feature.



The app stays at the splashscreen for 20 seconds, before the app is launched.

We have coding in DidFinishWithLaunchOptions, that initially fixed our main issue, which was that in the same circumstances (Connected with Wi-Fi that has no internet connection) it just crashed after 2 minutes on the splashscreen.


is there a more efficient way? right now it takes 20 seconds and i would like to reduce the time.


Don't try to make a network connection in didFinishWithLaunchOptions. That method needs to finish in a few seconds or your app will be terminated. Return from didFinishLaunching and then use either performSelector:withObject:afterDelay to start the network connection after didFinishWithLaunchOptions returns, or submit the network call on a background queue using GCD. The second approach would keep from freezing the UI while you attempt the network connection.

What, exactly, are you doing in didFinishWithLaunchOptions that's taking so long? Some code would help us help you.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.