Static libraries don’t seem to work, you must create bundles, and the js files in the bundle will be automatically converted into .txt files by the system. A better solution is to compress the js code and then perform URLEncode encoding to solve this problem.
You can package the files you need together into Framework 里面,然后通过 NSBundle 去获取这个文件。不同的是不能使用 mainBundle,因为此时的 mainBundle 指的引用 Framework this program. Of course your JS file cannot be found.
Solution:
File in Framework 的工程里面,Target->Build Phases->Copy Bundle Resources 里面加入你需要打包进 Framework
Static libraries don’t seem to work, you must create bundles, and the js files in the bundle will be automatically converted into .txt files by the system. A better solution is to compress the js code and then perform URLEncode encoding to solve this problem.
You can package the files you need together into
Framework
里面,然后通过NSBundle
去获取这个文件。不同的是不能使用mainBundle
,因为此时的mainBundle
指的引用Framework
this program. Of course your JS file cannot be found.Solution:
File in
Framework
的工程里面,Target->Build Phases->Copy Bundle Resources
里面加入你需要打包进Framework
Use when you need to read a file
PS:
Framework
It needs to be a dynamic library!