My app is calling a web service to retrieve some data, and I want to make the experience as best as possible. I figured out that using NSURLConnection it’s very hard to give good timely feedback.
Sometimes my iPhone tries to load the data for a minute or two and I see no way of figuring out what is taking so long, or why the download is so troublesome. Then after a few minutes I sometimes end up with an error code.
I’d like to display exactly what is happening. Messages like:
- “Establishing internet connection”
- “Trying to connect to server”
- “Connected…”
- “Downloading data…”
- “Download complete!”
And when there is trouble like server not reachable or DNS could not be resolved, it would be nice to just try again a few times and not simply quit and throw error.
Are there replacements for NSURLConnection which handle these things more gracefully and give better in-time feedback about what is happening?
Something that can help you achieve what you want. Since
ASIHTTPRequestis no longer being supported MKNetworkKit would be your best choice. To check for connectivity, you can always use Reachability.