I like organizing my classes into groups, in the Xcode 4 project navigator pane. I also use GIT versioning via the terminal, which works better for me than the Xcode 4 integration. To me it makes the most sense when the groups I create in Xcode correspond to real folders on my file system.

However, Xcode seems to not care about where a file (e.g. Objective-C .h/.m file) is on the filesystem, and every time you add a group (Option+Command+N) it's purely cosmetic, for any files you put in there will share the same location on your hard drive as the rest.

The weird thing is, that if you first create a folder on your hard drive, and then drag it to Xcode, you have created a group with its own location on your file system. Every file you create in there will be created in the folder on disk. I love that, but I'd love it even more if Xcode would do that for me at Option+Command+N. The workflow of switching to Finder for every group you want to create and then dragging it back to the right place in your project navigator is just plain silly.

It feels like something a setting would fix, but I can't find it! Is there a better way?

Update: When dragging a folder to Xcode, you'll get a dialog window where you can choose "Folder Reference". That looks promising, however my Xcode 4 doesn't accept the files in there as classes and keeps telling me it can't find any files. Maybe the answer lies here somewhere, but I still can't find it.

Another update: I've changed my main editor environment from Xcode to AppCode. The latter supports actually creating folders to back the project groups, while maintaining 100% compatibility with Xcode. Those AppCode guys sure know what they're doing.

没有正确的解决方案

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top