Resource files in subdirectory are copied to root directory of the app bundle Resource files in subdirectory are copied to root directory of the app bundle xcode xcode

Resource files in subdirectory are copied to root directory of the app bundle


When adding your Resources folder to Xcode, choose "Create folder references" instead of "Create groups for any added folders" in the sliding window.

That is, replace the 3 steps in your question with the following ones.

  1. Create a Resources directory under the root directory of the project. Organize your directory structure inside the Resources directory the way you want it to be.
  2. Drag the Resources directory to XCode and select the Create folder references option.

You're done. Xcode will copy the contents of your Resources directory recursively into the bundle.

You might have trouble further down the road when Xcode doesn't copy a modified file somewhere inside the Resources directory. A clean build usually fixes this. Alternatively, you can remove the .app file before building. This will not cause unmodified source files to rebuild, but will force Xcode to copy all of the resources anew.

Sample Folder Reference