Explanation of Xcode settings for folders added to project

后端 未结 3 760
醉梦人生
醉梦人生 2020-12-24 06:56

What is the difference between \"Create groups for any added folders\" and \"Create folder references for any added folders\"?

I have been doing this for quite some

相关标签:
3条回答
  • 2020-12-24 07:23

    Groups are only within your project and are for organization purposes only. They do not reflect what is on the file system nor where the files will be compiled into in the app.

    Folders are basically like including a folder on the file system, where if you move a file within a folder reference, it will be reflected in your project as well. These folders are also reflected inside your app bundle when its compiled.

    I usually use groups. For example, on the file system I have all my classes in a /Classes folder but have them separated in my project into groups, such as View Controllers, Custom Views, Data Model, etc. These don't really need to be separate in the file system but its nice to have in the project.

    Sometimes I'll use folder references if it's important for the organization be maintained once it goes to the app bundle, but that is pretty rare. Also, when including files from a third party library that could be updated often, you can use a folder reference so you don't have to remember to add files when they are added to the library.

    0 讨论(0)
  • 2020-12-24 07:33

    If you have a lot of images or audio files,you might want organize these files well, separate them in different folder instead of placing all of them in app root.

    Another situation, you have a project using UIWebView to load local html in your app.You may not want to mess up html, javascript, and css file.

    So, maybe organize these file hierarchically would be a good solution.

    0 讨论(0)
  • 2020-12-24 07:42

    When you create folders in your project the folders are also present in you apps bundle. Groups are ignored and all files in the groups are added to the apps bundle root.

    0 讨论(0)
提交回复
热议问题