Xcode 4: delete top-level folder

I accidentally added a folder to the top level of the workspace, because it is displayed in Xcode 4. That is, the folder is now next to my project at the top level, and I would like to delete it but I don’t understand how to do it. When I try, the delete option is disabled. I read somewhere that after creating a workspace, such a folder can be deleted. At the moment, I want to try to avoid this.

Is the metadata for this folder stored in the project.pbxproj file? I need to check the changes that I made for the project.pbxproj file, but not the metadata for the top-level folder I'm trying to delete.

Thanks.

+4
source share
2 answers

I also had this problem. To fix this, I manually deleted the section related to my unwanted group from the project.xcworkspace file in my .xcodeproj package:

  • In Finder, right-click on your package .xcodeproj and select Show Package Contents.
  • Open the project.xcworkspace file in your favorite text editor.
  • Completely delete the xml element named "Group" for the group you want to delete. I had to remove the following (my group was called New Group):

    <Group location = "container:" name = "New Group"> </Group> 
+6
source

This may be a specific Xcode (mine is 6), but in my case, it took another step to complement Stefan's answer:

  • Right-click .xcodeproj in Finder -> Show Package Contents.
  • Same thing for project.xcworkspace inside: right click -> Show package contents.
  • After that, open content.xcworkspacedata strong> with a text editor (by default, TextEdit is fine)
  • Remove tag :

     <Group location = "container:" name = "New Group"> ... </Group> 
+1
source

Source: https://habr.com/ru/post/1379918/


All Articles