I am using Storyboard with a Navigation Controller and prepareforsegue.
I have two UITableViews. If you click on a row in the first table you get to the second table.
The second table picks its data from a plist depending which row you clicked in the first table. This works fine as long there is an internet connection. If there is no internet connection it crashes.
Now I want to check if there is an internet connection before the second table loads. And if there is no internet connection I want to display an UIAlertView.
I would like to do this with NSURLConnection but I don’t know where to implement the code.
Will I put this in the .m of the first table at prepareforsegue or and the .m of the second table?
Thanks.
You should use Reachability Code Written By Apple.
Please Go Through This Link For Downloading the Reachability Files.
For using That Code You need to Import SystemConfiguration Framework.
Follow As Target->BuildPhase->LinkBinaryWithLibraries->Click”+”->Choose SystemConfiguration.
Then Import the #import “Reachability.h” Header in ViewController.
Then Just Write Few Lines Code Just before navigating To anotherView