App & Using Wi-Fi (Local Connection Only)

Discussion in 'iOS Programming' started by loon3y, Jan 9, 2014.

  1. loon3y macrumors 65816

    loon3y

    Joined:
    Oct 21, 2011
    #1
    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.
     
  2. Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #2

    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.
     

Share This Page