Rich Everhart
Rich Everhart

Reputation: 1053

XCode 4: Removing top-level folder

I accidentally added a folder to the top-level of the workspace as it is displayed in XCode 4. That is, the folder now sits right along side my project at the top-level, and I'd like to remove it but I don't see how. The delete option is disabled when I try. I read somewhere that after creating a workspace that such a folder is possible to delete. I'd like to try to avoid this for the time being.

Is the meta-data for this folder stored in the project.pbxproj file? I need to check in the changes I've made to project.pbxproj file but not the meta-data for the top-level folder I'm trying to remove.

Thanks.

Upvotes: 4

Views: 1032

Answers (2)

vir us
vir us

Reputation: 10755

Maybe it is Xcode specific (mine is 6) but in my case it was required to make one more step in addition to Stefan's answer:

  1. Right click on .xcodeproj in Finder -> Show Package Contents.
  2. The same for project.xcworkspace inside: right click -> Show Package Contents.
  3. After that open contents.xcworkspacedata with text editor (default TextEdit is ok)
  4. Remove the tag:

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

Upvotes: 1

Stefan Church
Stefan Church

Reputation: 1361

I also had this issue. To fix it I manually removed the section relating to my unwanted group from the project.xcworkspace file in my .xcodeproj package:

  1. In Finder, right click on your .xcodeproj package and click Show Package Contents.
  2. Open the project.xcworkspace file in your favourite text editor.
  3. Completely remove the xml element named 'Group' for the group you want to remove. I had to remove the following (my group was called New Group):

     <Group location = "container:" name = "New Group"> </Group>
    

Upvotes: 7

Related Questions