0

We are finding that our requestURL is not getting sent to the server by iOS7 clients, meaning we're not seeing these requests in the weblogs, and no errors are thrown. Everything is find iOS6; however, there's an odd difference in the format of the NSURLRequest, which could be the culprit:

In iOS6:

<NSURLRequest http://rentaldog.net/hello-from-dave>

In iOS7:

<NSURLRequest: 0xb114f60> { URL: http://rentaldog.net/hello-from-dave }

I guessed this might have something to do with whether caching was on, so I've turned it off (?) without any difference in behaviour.

Here are the relevant lines of code from the app:

NSString *pingServerURL  = @"http://ourserver.net/hello";
NSURLRequest *requestURL = [NSURLRequest requestWithURL:[NSURL URLWithString:pingServerURL] cachePolicy:0 timeoutInterval:60.0];
self.connection          = [[NSURLConnection alloc] initWithRequest:requestURL delegate:self];

Any ideas?

dfdumaresq
  • 1,468
  • 4
  • 15
  • 22
  • That's just a new format for the `description` property of the object. – Cyrille Jan 17 '14 at 13:37
  • 1
    Apparently however your question really looks like this one: [NSURLRequest cache issue iOS 7](http://stackoverflow.com/questions/18923675/nsurlrequest-cache-issue-ios-7) – Cyrille Jan 17 '14 at 13:39
  • Yes, that's what I thought, so I added the cachePolicy and timeoutInterval parameters but didn't get a different result. Any suggestions on testing further? I'm not even seeing simple requests access our host. I've built the sample project SimpleURLConnections and playing with that – dfdumaresq Jan 17 '14 at 17:48
  • Yes, that was it. My fault, I didn't RTFM. I assumed that zero would ignore the local cache. I wanted 1. Now it works. Thanks! NSURLRequestUseProtocolCachePolicy = 0, NSURLRequestReloadIgnoringLocalCacheData = 1 – dfdumaresq Jan 17 '14 at 21:03

1 Answers1

0

My problem was that the local cache was being used and subsequent requests were not directed to the server. I changed cachePolicy from 0 to 1 and it now works.

dfdumaresq
  • 1,468
  • 4
  • 15
  • 22