XCode 4:在项目中删除项目文件的问题

时间:2021-05-05 22:50:13

I am using XCode 4. Some time ago I added two sample projects to my main project. I didn't save it as workspace so al three projects are in the same one. The problem is that I cannot delete the sample projects from my main project. When I right click one of them, the delete option is disable. If I press CMD+Delete or Delete nothing happens.

我正在使用XCode 4。不久前,我在主项目中添加了两个示例项目。我没有把它保存为工作区,所以三个项目都在同一个项目中。问题是我不能从主项目中删除示例项目。当我右键单击其中一个选项时,删除选项是禁用的。如果我按CMD+删除或删除,什么都不会发生。

Thanks in advance.

提前谢谢。

4 个解决方案

#1


1  

It is probably a bug, but the Delete option is only active if you are working in an Xcode workspace, and not when opening a project file directly.
Start off by creating a new workspace in Xcode 4 (File > Save As Workspace), then you can add/remove projects as necessary.

这可能是一个错误,但是删除选项只有在您在Xcode工作区中工作时才会激活,而不是在直接打开项目文件时。首先在Xcode 4中创建一个新的工作区(将>文件保存为工作区),然后您可以根据需要添加/删除项目。

#2


1  

I had the same problem. On the far right, click on "Organizer". In the "Organizer", click on the Projects icon and then right click on the project you want to delete. Click on "Reveal in Finder". You will then be in the project directory in Finder. Go up one directory and delete the project. The next time you start Xcode, the project should be gone.

我也有同样的问题。在最右边,点击“组织者”。在“组织者”中,单击项目图标,然后右键单击要删除的项目。点击“在查找器中显示”。然后您将在Finder的项目目录中。进入一个目录并删除项目。下一次启动Xcode时,项目应该已经消失。

#3


1  

I know that this question is quite old, but I can tell that no one has got the answer to this question for a very long time so the following simple steps will get the work done.

我知道这个问题很老了,但是我可以告诉大家,在很长一段时间内没有人得到这个问题的答案,所以下面的简单步骤将使工作完成。

1- open up your .xcodeproj file in finder by right clicking on it and then selecting "show package contents".

1-打开你的.xcodeproj文件,点击右键,然后选择“显示包内容”。

2- delete the .xcworkspace file from the .xcodeproj package (dont worry it will come back once you start the project in later versions of xcode 4.0).

2-从.xcodeproj包中删除.xcworkspace文件(不要担心在以后的xcode 4.0版本中启动该项目后,该文件将返回)。

3- open the .xcodeproj in xcode 4.0 or later and vola.

3-在xcode 4.0或更高版本和vola中打开.xcodeproj。

According to my understanding the problem was caused by .xcworkspace file so deleting it was the perfect solution to this kind of problem.

根据我的理解,这个问题是由.xcworkspace文件引起的,因此删除它是这个问题的完美解决方案。

Enjoy.

享受。

#4


0  

XCode 4 is full of new features and also new bugs. For now I would suggest you create a new project and drag-copy only the files you need in your project.

XCode 4充满了新特性和新bug。现在,我建议您创建一个新项目,只拖放项目中需要的文件。

#1


1  

It is probably a bug, but the Delete option is only active if you are working in an Xcode workspace, and not when opening a project file directly.
Start off by creating a new workspace in Xcode 4 (File > Save As Workspace), then you can add/remove projects as necessary.

这可能是一个错误,但是删除选项只有在您在Xcode工作区中工作时才会激活,而不是在直接打开项目文件时。首先在Xcode 4中创建一个新的工作区(将>文件保存为工作区),然后您可以根据需要添加/删除项目。

#2


1  

I had the same problem. On the far right, click on "Organizer". In the "Organizer", click on the Projects icon and then right click on the project you want to delete. Click on "Reveal in Finder". You will then be in the project directory in Finder. Go up one directory and delete the project. The next time you start Xcode, the project should be gone.

我也有同样的问题。在最右边,点击“组织者”。在“组织者”中,单击项目图标,然后右键单击要删除的项目。点击“在查找器中显示”。然后您将在Finder的项目目录中。进入一个目录并删除项目。下一次启动Xcode时,项目应该已经消失。

#3


1  

I know that this question is quite old, but I can tell that no one has got the answer to this question for a very long time so the following simple steps will get the work done.

我知道这个问题很老了,但是我可以告诉大家,在很长一段时间内没有人得到这个问题的答案,所以下面的简单步骤将使工作完成。

1- open up your .xcodeproj file in finder by right clicking on it and then selecting "show package contents".

1-打开你的.xcodeproj文件,点击右键,然后选择“显示包内容”。

2- delete the .xcworkspace file from the .xcodeproj package (dont worry it will come back once you start the project in later versions of xcode 4.0).

2-从.xcodeproj包中删除.xcworkspace文件(不要担心在以后的xcode 4.0版本中启动该项目后,该文件将返回)。

3- open the .xcodeproj in xcode 4.0 or later and vola.

3-在xcode 4.0或更高版本和vola中打开.xcodeproj。

According to my understanding the problem was caused by .xcworkspace file so deleting it was the perfect solution to this kind of problem.

根据我的理解,这个问题是由.xcworkspace文件引起的,因此删除它是这个问题的完美解决方案。

Enjoy.

享受。

#4


0  

XCode 4 is full of new features and also new bugs. For now I would suggest you create a new project and drag-copy only the files you need in your project.

XCode 4充满了新特性和新bug。现在,我建议您创建一个新项目,只拖放项目中需要的文件。