views:

121

answers:

3

I'm building an application where I want to provide the user with a few dozen templates that will internally take the form of property lists. I would also want to group them in categories, which would conveniently be achieved using folders.

While I have contemplated shipping these files as simple resources in my application, I don't like the idea of this single location containing dozens and dozens of files, and besides it doesn't seem to be possible to group them in folders.

I can see that many applications have installed such resources in their application support directory (~/Library/Application Support//...), but I can't seem to find any documentation resource on how to achieve this.

+1  A: 

You can group items in sub-folders of your app bundle's Resources directory. Unless you want users to edit these plists, keeping them in your app bundle allows users to drag-n-drop install your app, rather than having to use an installer package (a big win).

Barry Wark
+1  A: 

You can group them into folders in your application bundle by adding a "New Copy Files Build Phase" to your project as described in this forum post:

http://forums.macrumors.com/showthread.php?t=458594

Frank Schmitt
+2  A: 

I don't like the idea of this single location containing dozens and dozens of files, and besides it doesn't seem to be possible to group them in folders.

It is. Put them in folders in your project directory, then add the top-level folder(s) to your project. Make sure you add it/them as folder reference(s) and not group(s) (see? that sheet does have a purpose!).

Then, add the folder reference(s) to your Copy Bundle Resources or Copy Files phase.

One word of warning: When you change one of the files in the folder, you may need to “touch” the folder to get Xcode to re-copy it. You can do this in Xcode or from the terminal.

Peter Hosey