iOS Question How to reset cache for webview ?

tucano2000

Active Member
Licensed User
Longtime User
Try this:

B4X:
Sub BrowserCacheReset
    Dim no As NativeObject = WebView1
    no.RunMethod("BrowserCacheClear", Null)  
End Sub


#If OBJC

@end

#import <Foundation/Foundation.h>

@interface UIWebView (ClearCacheWebView)
- (void)BrowserCacheClear;
@end

@implementation UIWebView (ClearCaheWebView)
- (void)BrowserCacheClear
{
    [[NSURLCache sharedURLCache] removeAllCachedResponses];
}

#End if

Source: http://stackoverflow.com/questions/2523435/how-to-clear-uiwebview-cache
 
Upvote 0
Top