【发布时间】:2012-01-08 03:46:22
【问题描述】:
我正在使用下面的代码将文本文件内容加载到 WebView 中,但每次调用该方法时,内容都需要一些时间来加载。我可以在这种情况下使用缓存策略以使其加载更快吗?
- (void)displayContent
{
@try {
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"about-us" ofType:@"txt"];
[web_view loadHTMLString:[NSString stringWithContentOfFile:filePath encoding:NSUTF8StringEncoding error:nil] baseURL:nil];
} @catch(NSException e) {
NSLog(@"%@",e);
}
}
感谢您的帮助,
斯蒂芬
【问题讨论】:
标签: iphone objective-c cocoa-touch ios4 uiwebview