Xcode 4.x adds a new project to the workspace

You might think that adding a project to a workspace in Xcode would be intuitive.

1) But when you add a new project, it is added to the existing project. It must be a mistake, or there really is a reason.

2) How do you add a project (ctr + right click et.)

+7
source share
4 answers

You can use the plus (+) button in the lower left corner of the Xcode IDE to add a new project to the workspace. You must first have an empty workspace, which you can use in the menu ( New / Workspaces with short abbreviations ^% N ).

enter image description here

+14
source

By morning, I spend some time doing what you requested. so here are the steps (you can skip if you have already followed some).

  • Create a new empty workspace
  • Add a project to it by clicking File-> Add new files to "Your workSpace" or "command + option + A"
  • Select a project folder or yourproject.xcodeproj file

Just let the indexing finish correctly, and congratulations that you have successfully added a new project to the xcode workspace.

Note. . Make sure that the project you are adding is not already open, Xcode gets lil-sensitive about it and in this case does not display the file tree in the workspace.

+6
source

My answer is for Xcode 5, but should also be for Xcode 4.

In a typical Apple mod, they gave you several ways to do almost the same thing. Very confusing and annoying. There are three ways, and only one way relates to the original question:

(1) Use File → Add Files to ... The problem with this is that it will only add files to the workspace if the NO project is selected. The problem with THAT is that when you select a project, I don’t know how to cancel it.

(2) Use the “+” in the lower left corner. The problem with this, this is equivalent to using a drop down menu (# 1 above)

(3) Right-click on the left panel (in an empty area) and you will see “Add files to” This is the only right way to do this, as it ensures that the file is added to the workspace, and not any one selected project.

Try all three methods after selecting an existing project and you will see what I mean.

Based on my previous experience with Xcode, Apple will take about 10 years to fix such things.

+4
source

You might think that adding a project to the workspace in Xcode would be intuitive.

Of course not, this is Apple, only for some experts ...

1) But when you add a new project, it is added to an existing project - This should be a mistake, or is there really a reason

You missed the "Add To:" drop-down list in the last of the three dialog pages that show the location of the .xcodeproj file. There you can select the workspace that you are currently using. So just use the "File" "Create ..." "Project ...", give it a name and choose from the templates, and NEVER intuitively double-click on the directory where to put the project file, but do not forget to adjust the selection drop-down list in current open workspace. Of course, this choice is never chosen.

+2
source