I ran into the same problem and made sure that setting cachePolicy = 0
instead of cachePolicy = NSURLCacheStorageNotAllowed
fixes the problem.
This does not make sense to me, since 0 corresponds to NSURLCacheStorageAllowed
.
We cannot just set it to 0, as Apple is likely to fix this in a future version.
You can try calling:
[NSURLCache sharedURLCache] removeCachedResponseForRequest:yourRequest]
before starting the request.
UPDATE: After further research, I found that the broken code uses the wrong enumeration. Take a look at NSURLRequestCachePolicy in NSURLRequest.h. This is the one you need and it explains why setting to 0 fixed the problem for you.
source share