Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我编写了一个脚本,可以将一些 HTML 文件下载到我的应用程序的 Documents 文件夹中!我想在我的 WebView 中加载这些文件,这可能吗?
例如:如果 index.html 存在于 Documents 文件夹中,则加载它,否则将 index.html 加载到 mainBundle 中!
感谢大家可以帮助我!
当然,只需使用:
[webview loadRequest: [NSURLRequest requestWithURL: [NSURL fileURLWithPath: [@"~/Documents/index.html" stringByExpandingTildeInPath]]]]