sepala
Aspiring developer
Profile
Posts: 196
Reg: Nov 23, 2011
London
3,060
03/29/12 06:38 AM (13 years ago)

Adding JS files to the BT_Docs folder

Just figured this out so thought I would share it with everyone to save them the time I just spent working it out! If you add a JS file to BT_Docs it won't work straight off and you will get 2 errors when you run your app. If you click on the sample.js file in there it says: "IMPORTANT: IF YOU INCLUDE .JS FILES IN YOUR XCODE PROJECT YOU MAY SEE THIS WARNING WHEN COMPILING, OR, THE Javscript FILE WILL NOT BEHAVE AS EXPECTED. "warning: no rule to process file '$(PROJECT_DIR)/sample.js' of type sourcecode.javascript for architecture i386" TO FIX THIS, YOU MUST TELL XCODE NOT TO COMPILE THE .JS SOURCE CODE FILE, DO THIS IN THIS ORDER: a) Expand your target in the Groups and Files list b) Remove the JavaScript file from the Compile Sources folder if it exists. Expand Targets > project-name > Compile Sources c) Click and drag the javascript file into the Copy Bundle Resources folder. Exapand Targets > project-name > Copy Bundle Resources This process does not move the actual file. " This maed very little sense to me until I realised it is instructions for an older version of Xcode. Here are the new instructions: "For Xcode 4, click on the main project, click on Build Phases, and you'll find Compile Sources and Copy Bundle Resources." Now my JS file works great!
 
coderx
Veteran developer
Profile
Posts: 433
Reg: Oct 29, 2011
Ontario, Canada
8,680
like
03/29/12 06:47 AM (13 years ago)
thanks for sharing, very good guide for those who want to add custom JS files:)
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
03/29/12 07:21 AM (13 years ago)
Excellent stuff...thanks! Thumbs up to you! Mark
 
naastie
Apple Fan
Profile
Posts: 28
Reg: Feb 27, 2012
Latrobe, PA
2,530
like
03/29/12 09:26 AM (13 years ago)
Thanks Naas
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.