本文介绍了无法添加文件iOS应用程序捆绑包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在资源路径中添加了扩展名为 .js
的空文件,但未将其添加到应用程序的捆绑软件中。
我确定我已经添加了应用程序目标,但是有时它包含在捆绑软件中,有时它不包含在捆绑软件中。
我正在获取文件的内容按以下代码进行:
NSString * filePath = [[NSBundle mainBundle] pathForResource:@ webscript ofType:@ js ];
解决方案
请确保将此文件添加到目标: / p>
还要检查文件是否位于目标->构建阶段->复制捆绑资源
I have added an empty file with extension .js
in resource path but that is not added to application's bundle.
I am sure that I have added to application target, but sometimes it includes in bundle and sometimes it doesn't include in bundle.
I am fetching the file's content by following code:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"webscript" ofType:@"js"];
解决方案
Make sure you add this file to the target:
Also check if file is in Target -> Build Phases -> Copy Bundle Resources
这篇关于无法添加文件iOS应用程序捆绑包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!