uiwebview因为Cache而崩溃,我该如何删除UIwebview Cache?

时间:2012-09-11 10:53:06

标签: iphone objective-c ios

由于Cache,uiwebview崩溃,我如何删除UIwebview缓存?如果有人知道那么请帮助

- (void)webViewDidFinishLoad:(UIWebView *)webView {
headingLabel.text= @"Crop Browser";
spinner.hidden= true;
webview.hidden= false;
closeButton.hidden=YES;

NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil];
[NSURLCache setSharedURLCache:sharedCache];
[sharedCache release];
sharedCache = nil;
// remove all cached responses
[[NSURLCache sharedURLCache] removeAllCachedResponses];

// set an empty cache


NSLog(@"webfinish");
if(cropButton.tag!=1)   //1 would mean the crop button is hidden manually (user pressed crop button)
    cropButton.hidden= false;
}

0 个答案:

没有答案