Xcode Project Resource Organization and Structure

前端 未结 4 1793
执笔经年
执笔经年 2020-12-12 18:44

I am relatively new to Xcode and one thing that has bothered me is that when I add a resource it gets added to the top level directory of my project directory. So for exampl

4条回答
  •  时光取名叫无心
    2020-12-12 18:52

    Life is hard for IDEs. They have to mediate between a filesystem world, where the compiler, with its source files live, and the UI world, where programmers work.

    In the old times that formed the contemporary coding culture, everybody, compilers and people, used to live all togheter in the filesystem. So today we still have a tendency to think we want to control where sources and resources reside on the disk. That is good, because we may need to know exactly what compilers eat.

    Anyway if you think your IDE just as a the frontend of a funny database system of source code and if you really have full confidence about its capabilities and features (which is seldom the case), you may get to the conclusion that if you just don't care about the filesystem you may have a better life, as a programmer (and as a human being).

    You're right wondering, because Xcode is not very good nor friendly about filesystem code organization and people that is (correctly) picky on that will learn how to move files on their right folder on disk, and on their right Xcode group. That, if you use the "Create folder references for any added folders", have a 1:1 relation.

    But you will see many people, and many project examples from Apple itsef, that use a simple flat filesystem tree with everything in the same folder.

    My advice is that you at least group public headers and resources in different folders, something à la Java/Maven, but there is no universal convention.

提交回复
热议问题