Maximilian Körner
Maximilian Körner

Reputation: 894

predefine folder hierarchy in Documents folder

i just realized that all my groups in Xcode are ignored and all files i added to my project are copied into the Documents folder directly.

As i have several different types of files i want to keep them organized from the beginning.

So is there a way to predefine a folder hierarchy in the Documents folder of my app and place my files in the corresponding folders or do i have to move them manually on my first app launch?

regards and thanks for any help in advance! Max

Upvotes: 0

Views: 47

Answers (1)

rmaddy
rmaddy

Reputation: 318944

Nothing in your app automatically goes into the Documents folder when an app is installed. Your app must specifically copy or create files in the Documents folder. You are free to create any subfolder layout you want in the Documents folder. This must all be done at runtime.

If your goal is really to package your app so certain resource files are organized into a fixed folder structure in the app's resource bundle, then that is a different issue. This can be done but it requires that when you create the folders in your project, you don't simply make a group, you must create an actual folder reference. Folder references appear as blue folder icons in Xcode, not yellow like all other group folders. When you add files to your resources, the dialog that appears for the file chooser, be sure to select "Create Folder References for any added folders" instead of the "Create groups for any added folders".

Upvotes: 1

Related Questions