When my iPad application makes a web request using the ASIHTTP library it will fail if there is no internet connection.
I want to identify specifically when there is no internet connection and show a unique error to the user (vs. just identifying that the call failed which can happen for a large number of reasons: e.g. The target website is down.)
I’ve noticed ASIHTTPRequest returns a Status Code 0 when there is no Internet Connection available. If the webpage is not available or another error occurs in communication with the server, it returns an actual HTTP Status Code.
In this case, You could just check to see if
request.responseStatusCode == 0is true and act on that