有人可以说明我将如何使其工作: http: //www.icab.de/blog/2009/08/18/url-filtering-with-uiwebview-on-the-iphone/
我尝试在我的项目中制作“FilteredWebCache.h”和“FilteredWebCache.m”文件,但它说“FilterManager.h”不存在。我打算如何处理这些文件?
我把这个放在 viewDidLoad 中:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docDir = [paths objectAtIndex:0];
NSString *path = docDir; // the path to the cache file
NSUInteger discCapacity = 10*1024*1024;
NSUInteger memoryCapacity = 512*1024;
FilteredWebCache *cache = [[FilteredWebCache alloc] initWithMemoryCapacity:memoryCapacity diskCapacity:discCapacity diskPath:path];
[NSURLCache setSharedURLCache:cache];
[cache release];