How to add js file to my xcode project?

前端 未结 3 1129
一个人的身影
一个人的身影 2020-12-08 04:38

I add some js and css files in my xcode left project tree. but when I build this project , I got the warning : no rule to process file \'$(PROJECT_DIR)/js/builder.js\' of ty

3条回答
  •  鱼传尺愫
    2020-12-08 05:22

    When you add the JavaScript file, Xcode detects that the file is a source code file, assumes you want to compile it and automatically adds it to the Compile Sources build phase.

    To stop Xcode trying to compile it and make it copy the file instead, expand your target in the Groups and Files list, remove the JavaScript file from the Compile Sources build phase and add it to the Copy Bundle Resources build phase.

提交回复
热议问题