How Do I Embed Local HTML into Cocoa Binaries?

I'm using Objective C for a Cocoa application on OSX with some local HTML files that get loaded into a Webkit widget. However, a virus could easily modify those HTML files. So, I added a CRC hash to detect tampering, which shows a warning and then closes the application. However, is there a way to additionally protect the local HTML further s uch as compiling it into the binary of the application itself , or compiling into a single resource file ? I noticed with Qt that they have a way to put the HTML into a resource file and then change the webkit URLs to load from there instead of file://. But this is Objective C in this case.


It's not possible from Objective C or Swift like it is from Qt. There is no HTTP URL that you can pass to the WebKit widget to pull content out of the Asset Catalog.

链接地址: http://www.djcxy.com/p/34826.html

上一篇: 在React原生Webview中使用自定义字体

下一篇: 我如何将本地HTML嵌入到可可二进制文件中?