ios - NSURLCache does not clear stored responses in iOS8 -


I call the sample function when I need to clear the cache and make a new call to the URL

  - (zero) clearDataFromNSURLCache: (NSString *) urlString {NSURL * requestUrl = [NSURL URLWithString: urlString]; NSURLRequest * dataUrlRequest = [NSRR request request with url: requestUrl]; NSURLCache * cache = [NSURLCache sharedURLCache]; NSCachedURLResponse * cacheResponse = [Cash Cached ResponseAndest: Data URL Request]; If (Cash Response) {NSString * dataStr = [NSString string withUTF8 string: [[Cash response data] bytes]]; NSLog (@ "data SR R =% @", data STR); NSLog (@ "url str r =% @", [[[Cash response response] URL] full string]); [Cash store cached response: Request for zero: data url request); [NSURLCache setSharedURLCache: cache]; } [[NSURLCache shared URLCache] removeCachedResponseForRequest: dataUrlRequest]; // Check that the respnase data from the cache NSURLRequest has been deleted / deleted * finalRequestUrlRequest = [NSURLRequest requestWithURL: requestUrl]; NSURLCache * finalCache = [NSURLCache sharedURLCache]; NSCachedURLResponse * finalcacheResponse = [last cache cacheresposporeandest: finalquest urlestest]; If (finalcacheResponse) {// should not be entered here NSString * finaldataStr = [NSString stringWithUTF8String: [[finalcacheResponse data] bytes]]; NSLog (@ "data string r =% @", final data STR); NSLog (@ "url str r =% @", [[[Cash response response] URL] full string]); }}   

The response to iOS 6/7 has been successfully removed for requestURL, but it is never removed in iOS 8 I have searched but why not in iOS8 The reason should not be found.

Any help would be appreciated ?? | ..

NSURLCache has been broken on iOS 8.0.x - it Never crashes the cache, so it grows without the limit See detailed cross-checking for cache parts in 8.1 beta - but removeCachedResponseForRequest: is not .

removeCachedResponsesSinceDate: does work on iOS 8.0 - an API that was added for 8.0, but not yet in the docs Created (this API is in DEFS). I do not make it clear that its use is for anyone - of course, what you normally want to do is remove the cached responses before on a particular date.

removeAllCachedResponses well - but this is a real sledgehammer solution

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -