Ios – Why in Xcode, Groups can be created, but not real folders

iosiphonexcode

When doing iOS programming, it is interesting that in Xcode (4.3.2), we can create groups, such as a group call Images, and add files to it (either as a link or choose "Copy items into group's folder"). So it looks like a real folder in the navigator, and it even mentions "copy into … group's folder", but in fact there is no folder. All added files are in the same location as the .m and .h files.

Why would we want Groups, but not real folder? Is there advantage of Groups over the use of a folder?

Best Answer

This is a pet peeve of mine.

I recommend, making the folder in your file system, where you have your project files, then drag that folder into Xcode where you want the group. It will act like any other group, but now be linked to the folder on the file system. Adding files to that group in Xcode now adds them to the folder in the file system.

Much cleaner way of working and helps when locating files in big projects. Keeps git cleaner too.

Update for Xcode 9:

Once you have the groups in Xcode matching the directory structure on disk, moving a file from one group to another in Xcode will now move the file correctly on disk to match.