Xcode will treat any source code file that you add to it as needing to be compiled (.c, .m .js & so on…) and hence adds it to the Compile Sources folder under the application target. However, we don't want Xcode to actually do this to our javascript files as it will then throw an error something like the code below:
- Code: Select all
warning: no rule to process file '$(PROJECT_DIR)/KillerApp/script.js' of type sourcecode.javascript for architecture i386
--------------------------------------------------------------------------------------
Xcode 4
--------------------------------------------------------------------------------------
You'll know that there's an issue when using Xcode 4 as there will be a yellow warning icon in the central bezel:
You can also check for issues by clicking the warning icon above your file list:
This is how to move your .js file from the "Compile Sources" folder to the "Copy Bundle Resources" folder:
And courtesy of Big-O, here's a video demonstration
--------------------------------------------------------------------------------------
Xcode 3
--------------------------------------------------------------------------------------
It's a little easier to find in Xcode 3. Just drag the files from the Compile Sources folder to the Copy Bundle Resources folder. These are found in the Targets folder, in your Groups & Files pane (on the L/H side of Xcode 3)
