在 Xcode 中删除/移除组
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4907059/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Deleting/Removing Group in Xcode
提问by element119
I seem to be having a very odd problem with my iPhone project in XCode4.
我在 XCode4 中的 iPhone 项目似乎有一个非常奇怪的问题。
By accident, I seem to have dragged a new group I created out of my main project group:
不经意间,我好像从我的主项目组中拖出了一个我创建的新组:
When I try to move the group back into the project group, XCode crashes. When I try to delete the group by dragging it to the trash can, no such luck either. Is this because it's an iPhone project, and I somehow have messed up the entire directory of groups?
当我尝试将该组移回项目组时,XCode 崩溃了。当我尝试通过将其拖到垃圾桶来删除该组时,也没有这样的运气。这是因为它是一个 iPhone 项目,我不知何故弄乱了整个组目录?
采纳答案by element119
Solved- I hit the delete button with the group selected, and clicked "Continue" when presented with the error dialogue, which ended up removing the group.
已解决 - 我在选择了组的情况下点击了删除按钮,并在出现错误对话框时单击了“继续”,最终删除了该组。
回答by bendigi
I figured it out. I had this empty group or folder whatever it is (let's call it "stubborn group") at the same level than my project. I wasn't able to delete it since the option was disable when I right clicked on it.
我想到了。我有这个空组或文件夹,无论它是什么(我们称之为“顽固的组”)与我的项目处于同一级别。我无法删除它,因为当我右键单击它时该选项被禁用。
This is how you can remove the "stubborn group"
这就是你如何去除“顽固的群体”
- Right click on your project and select "New Group from Selection" This will create a new group named "New Group" and put your project in it
- Now drag your project outside of "New Group" to the top (not inside) of the "Stubborn group"
- Next is to highlight both groups and "Delete"
- 右键单击您的项目并选择“从选择中新建组”这将创建一个名为“新组”的新组并将您的项目放入其中
- 现在将您的项目从“新组”外部拖到“顽固组”的顶部(而不是内部)
- 接下来是突出显示两个组和“删除”
回答by LSD
Not even the "delete button on my keyboard" was working for me. I edited the ProjectName.xcodeproj/project.xcworkspace/contents.xcworkspacedata file to remove the Group element. Xcode4 noticed that the file was changed by another application, asked if I wanted to keep the change, and closed the project. I re-opened the project and the group was gone.
甚至“键盘上的删除按钮”对我都不起作用。我编辑了 ProjectName.xcodeproj/project.xcworkspace/contents.xcworkspacedata 文件以删除 Group 元素。Xcode4 注意到该文件已被另一个应用程序更改,询问我是否要保留更改,然后关闭项目。我重新打开了这个项目,小组就不见了。