I'm trying to implement Reachability in my app. I have it in applicationDidFinishLaunching
. If my connection is really bad and I launch the app, Reachability takes forever and often crashes the app with an The application failed to launch in time
error message.
So instead, I tried putting the call to Reachability in a background thread. But when I do this, I no longer receive the Reachability notifications.
Where should I be calling Reachability?
Edit:
I added TonyMillions' Reachability code per the suggestion below, but I'm still getting the same application failed to load in time
error when in very bad network conditions. To reproduce what I'm seeing, go to Settings.app -> Developer -> Network Link Conditioner, turn it on and set it to 100% loss.
Does your app still load in that condition?