![](/img/trans.png)
[英]Display Local HTML file from documents directory in a UIWebView on iPhone
[英]Display HTML Pages from Documents Directory in UIWebView
我要解压缩EPUB文件并将其存储在文件夹内的Documents目录中。
现在,我想在UIWebView中显示所有HTML页面,并在tableView中显示所有HTML页面名称。
例如,如果我有Introduction_1.html
那么我想在表格视图中显示“ Introduction_1”,依此类推。
提前致谢
这里documentDirectory代表文档目录的路径。 如果您的文件位于文档目录之外的其他位置,则显然可以将路径放在此处。
NSArray *dirContents = [[NSFileManager defaultManager] directoryContentsAtPath:documentDirectory];
NSString *strFinalPath = [dirContents stringByAppendingPathComponent:@"OEBPS"];
for (NSString *tString in strFinalPath)
{
if ([tString hasSuffix:@".html"])
{
NSLog(@"File name -> %@",tString);
}
}
希望对您有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.