I recently noticed that my code that uses AFNetworking (the latest version from the main branch) stops working under iOS 6. Here is my code:
httpClient = [AFHTTPClient clientWithBaseURL:[NSURL URLWithString:baseURL]]; httpClient.operationQueue.maxConcurrentOperationCount = 1;
where httpClient is a class variable.
Then I create a query:
NSMutableURLRequest *signInRequest = [httpClient requestWithMethod:@"POST" path:@"/user/register" parameters:dataToSend]; signInRequest.timeoutInterval = 15.0; signInRequest.cachePolicy = NSURLRequestReloadIgnoringLocalAndRemoteCacheData; AFJSONRequestOperation *signInOperation = [AFJSONRequestOperation JSONRequestOperationWithRequest:signInRequest success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
All other queries are constructed similarly. The first running operation works well, I can get into the success handler block. However, the following calls to other requests end in error processing and a request timeout error, regardless of how large the timeout value that I choose.
I made the same calls using plain NSURLConnection , writing tons of code :), the requests were successfully processed properly.
I switched to iOS 5 device and the code above works fine.
I switched to a 3G connection (iOS 6) and the code above works.
It seems that I only have this problem in WiFi connections (except when I'm on the same subnet with my REST server.)
Any thoughts on this?
Thanks in advance.
anticyclope
source share