【发布时间】:2014-11-21 10:35:38
【问题描述】:
我正在从服务器下载 zip 文件。在 NSCachesDirectory 我有 html 文件,我想知道如何使用他们的源文件运行 html 文件,我已经粘贴了我的代码。请帮帮我
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString *documentsPath = [[paths objectAtIndex:0] stringByAppendingPathComponent:[NSString stringWithFormat:@"/Lesson-file/Lesson%d",[str_lsn_id integerValue]]];
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"story_html5" ofType:@"html" inDirectory:documentsPath]];
[lsn_play_webview loadRequest:[NSURLRequest requestWithURL:url]];
【问题讨论】:
-
以上代码对我不起作用
-
答案链接是一种方法,而不是您问题的确切答案!。顺便说一句,你说你有像 css 和 js 这样的源文件。这些文件是从服务器下载的?或者它们是超链接?这些文件是否与html文件在同一目录中?
-
所有的html、css、js和图片都是从服务器下载的一个文件夹。
标签: javascript html ios zip nsurl