Adding Folder to Xcode Project is not Properly added

若如初见. 提交于 2019-12-05 12:49:03

问题


Team,

I created the new Project, on project folder right click open show in finder there I created "ViewControllers" Folder and again right click Add files to "ProjectName" then I added the created folder i.e., "ViewControllers" which is in blue colour "Expected yellow colour folder" that is reference to my project folder the blue colour folder is not. In blue colour folder when i try to added new file its added an empty File.

How can i reference my added folder to the Xcode project? how to avoid this blue colour folder class in my project?

Your inputs are highly appreciable.


回答1:


If your Xcode project looks like this…

…then you've added your ViewControllers folder as folder reference.

To change this folder to a group follow these steps:

  • Right click on ViewControllers
  • Choose Delete in the context menu
  • Choose Remove Reference in the dialog that popped up. The folder will be removed from your Xcode project but not from the file system.
  • Then choose Add Files to <YourProjectName>… in the File menu
  • Find your ViewControllers in the file system
  • Before clicking Add make sure that the option Create groups is selected
  • Click Add

You've added your ViewControllers folder as group:


Important note regarding Xcode 8:

The option Create groups might not be visible right away. Apple moved this in Xcode 8 to the bottom of the Add Files to… dialog:

This reveals the option Create groups:



来源:https://stackoverflow.com/questions/39983391/adding-folder-to-xcode-project-is-not-properly-added

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!