Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a folder to Xcode project

I have a folder full of files on my iPhone app which I want to use, but Xcode will not let me add folders to the bundle, only its files. I can't do this because I want it to be a bit more convenient, so I can reference the folder in my code. So, how do I do this? The compile settings in the build targets won't let me add the folder, only its files.

like image 944
Romejanic Avatar asked Dec 01 '13 23:12

Romejanic


1 Answers

Drag the source folder to the project "Groups & Files" area, say under the Resources group. In the dialog select "Create Folder References for any added folders". This will create a blue folder and the folder will and it's inter hierarchy will appear in the apps resources. This will automatically create an entry in "Copy Bundle Resources" build phase This is commonly done for image & help files. Any changes made to the folder will also change the files included by Xcode.

Note the important thing here: the folder must be a Folder Reference (blue folder). If it's a group (yellow folder), delete it and all its contents from your project tree, then re-add as a Folder Reference. Then make sure that's in the Copy Bundle Resources build phase. – cdespinosa

like image 192
zaph Avatar answered Oct 13 '22 16:10

zaph