NSURLConnection timeout on iOS 6 but not on iOS 5

I have an application that used NSURLConnection and worked fine on iOS 5, now the same code gets an instant timeout in iOS 6.

Any idea on what could change between the two versions 5.1 and 6.0?

+4
source share
1 answer

In iOS 5.1 and previous versions, the timeout interval set when constructing the request body was ignored for one reason.

iOS 6 seems to attract attention and more accurately describes the timeout interval, so just set the interval to a value large enough to give time to complete the request.

NSMutableURLRequest *request=[[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString: url] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:60.0]; 
+9
source

Source: https://habr.com/ru/post/1435923/


All Articles