views:

860

answers:

3

I have an Xcode project with the following group structure:

ProjectName/
    Classes/
        class1.h
        class1.m
        class2.h
        class2.m
        ...
    XMLDocs/
        doc1.xml
        doc2.xml
        ...
    Resources/
        Info.plist
        MainMenu.xib
        ...

and so on and so forth.

I'd like this to be represented in the folder structure on the disk as well:

ProjectFolder/
    Project.xcodeproj
    Classes/
        class1.h
        class1.m
        class2.h
        class2.m
        ...
    XMLDocs/
        doc1.xml
        doc2.xml
        ...
    Resources/
        Info.plist
        MainMenu.xib
        ...

as opposed to the usual everything in the root project folder methodology.

Is there any way to do this without manually creating the folder structure on the disk and then having to repoint all the reference in Xcode to the new location?

Bonus points if you can tell me how to do this automatically any time I create a new group or add files to an existing group in Xcode.

+1  A: 
amrox
Thanks, that helps for adding future items, but is there any way to turn the existing groups into folders?
Lawrence Johnston
+2  A: 

There's no "make my disk look like my project structure" functionality in Xcode.

You could automate the task using AppleScript, though: You can both examine and change project structure from a script. So you'd just have to write a script that iterates over the project structure and makes the folder hierarchy look the way the project structure does, and adjust where Xcode's file and group references point at the same time.

Chris Hanson
A: 

But when you update any of the files in your data folders - it doesn't update the file in my application package. Well, that's what I see here at the moment - when I update one of my data files for my app - it will not be updated in the app res folder. A reference of a complete folder should do this - correct - but it doesn't for me? Any hint?

Andy