How to add js file to my xcode project?

前端 未结 3 1115
一个人的身影
一个人的身影 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:00

    I got the same problem and I could solve this problem with simple technique in Xcode5. when you add/drag your HTML files into Xcode bundle you need add them by grouping as 2 types

    1.assets

    2.index.html

    you need to add these two files only.

    assets folder contains all HTML files like images,.js, content,css. All HTML files should be
    included in assets folder. what I mean is you need to group all HTML files in assets folder as a single folder.

    Then you drag that particular folder which contains ASSETS and INDEX.HTML files into Xcode bundle.

    Then do some changes in your controller declaration and implementation sections. That's it you can run your application in simulator now.If any one have not understood my answer please let me know I will add clear information with screen shots.

    I hope it will help some one..Thank you!

    If anyone have any doubts still let me know i'll explain step by step

    0 讨论(0)
  • 2020-12-08 05:17

    For Xcode 4, click on the main project, click on Build Phases. Open up Compile Sources and Copy Bundle Resources then you can then simply drag the files from one to the other.

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题