tags:

views:

18

answers:

1

How can i setup my Xcode project so that it creates new class files (.h/.m) in Classes directory and new interface files (.xib/.nib) in Interfaces directory?

By default Xcode adds new files in the root project directory, and i have to manually put these into Classes and Interfaces directories.

Edit:

I'm referring to the Xcode File > New File... option. I want the new files created from the Xcode project to move automatically to corresponding directories e.g. .h/.m files get automatically created in Classes directory, and .xib get automatically created in Interfaces directory etc. And i mean physical directories, not Xcode "Groups".

+1  A: 

I assume you've made a group (folder) called Classes, or something along these lines, inside your Xcode project. Select it and do Command+I (or right-click it and select Get Info). Change the "Path" option to the place where you want files to be created.

Please note that it will only affect files you create on it. Creating them elsewhere then moving them to this group will not move them into the directory.

zneak
Thanks for posting the answer. Actually, i was talking about the File > New File... option. I want the new files created from the Xcode project to move automatically to corresponding directories e.g. .h/.m files get automatically created in Classes directory, and .xib get automatically created in Interfaces directory etc. And i mean physical directories, not Xcode "Groups".
Mustafa
@Mustafa: I don't know how you can do that (if you can). Usually, to create files, I right-click groups and do "Add -> New File...", which creates them in the folder the group points to.
zneak

related questions