I have network handling code in my app (using NSURLConnection/NSURLRequest) and I would like to test how its behaving when the timeout for the connection expires before its received a response.
Any there any techniques/tools for simulating this on the simulator and device?
(NSURLRequest apparently does not allow a very short time out to be set, i.e. one second, but I have yet to check if this is indeed the case)
I would recommend using Charles Proxy. This application is a swiss-army knife tool set for any application that uses HTTP communication. You can adjust throttling speed (potentially long enough to trigger tour timeout) as well as mapping remote hosts to a local server (and vice-versa). There are a ton of options and tools – and I find it very useful.
http://www.charlesproxy.com/