I have a UISwitch
and if it's active my UIWebView
should cache all visited websites.
If it's active I have the following code
[[NSURLCache sharedURLCache] setDiskCapacity:4 * 1024 * 1024];
[[NSURLCache sharedURLCache] setMemoryCapacity:32 * 1024 * 1024];
[self setRequestObj:[NSURLRequest requestWithURL:loadUrl cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:60.0]];
If I deactivated my UISwitch
my code do something like this
[[NSURLCache sharedURLCache] setDiskCapacity:0];
[[NSURLCache sharedURLCache] setMemoryCapacity:0];
[self setRequestObj:[NSURLRequest requestWithURL:loadUrl]];
Is there some method I have to activated it works correctly? If it's switched off it should load everything from the web server at every call. If it's switched on it should load everything from his cache if he has visited it before.
If I close the app and open it again and my Button
is still switched to on it seems there is no cache although I didn't delete it if I close my app.
Sry if it's complicated to understand ;).