Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undo "New group from selection" project xcode 4

I accidentally added my project to a group, and now I can't remove it from it in xcode 4, any ideas? If I drag it out, it asks me to create a workspace...

The problem

EDIT: I reported this to apple in the bug reporter, I'll keep you guys updated

like image 434
allaire Avatar asked May 06 '11 04:05

allaire


2 Answers

This is a project without a workspace?

Close Xcode. Back up the .xcodeproj, then right click the original and Show Package Contents. Inisde, you'll see a file called project.xcworkspace. This is a workspace created by Xcode when a project is open without a xcworkspace, and it contains this grouping information.

Move this to the trash and reopen the project in Xcode; it will generate a new, default project.xcworkspace without the grouping.

like image 115
Steven Fisher Avatar answered Oct 04 '22 13:10

Steven Fisher


or you can just manually edit the contents.xcworkspacedata file to do this:

  1. close xcode
  2. right click on your project's .xcodeproj, then click "Show Package Contents"
  3. inside .xcodeproj, right click on project.xcworkspace, then click "Show Package Contents"
  4. inside project.xcworkspace, open contents.xcworkspacedata with a text editor. remove the < Group > section from the xml and just leave the < FileRef > section intact like so:

    From :

    <?xml version="1.0" encoding="UTF-8"?> <Workspace    version = "1.0">    <Group       location = "container:"       name = "New Group">       <FileRef          location = "self:ProjectName.xcodeproj">       </FileRef>    </Group> </Workspace> 

    Into:

    <?xml version="1.0" encoding="UTF-8"?> <Workspace    version = "1.0">    <FileRef       location = "self:ProjectName.xcodeproj">    </FileRef> </Workspace> 
  5. save it and re-open your xcode project and it would be back to normal.

like image 38
vinceville Avatar answered Oct 04 '22 13:10

vinceville