9

One would think that adding a project to a Workspace in Xcode would be intuitive.

1) But when you add a new project it is added within the existing project - It must be a bug, or is there actually a reason.

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

rptwsthi
10.2k10 gold badges72 silver badges113 bronze badges
asked Jun 13, 2012 at 18:54
1
  • Doesn't do that for me. File -> New -> Project; Choose template -> Next; make up a product name -> Next; Create (place it wherever you normally place your projects). Worked fine! Commented Aug 9, 2012 at 16:44

4 Answers 4

14

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

enter image description here

answered Aug 7, 2013 at 17:51
Sign up to request clarification or add additional context in comments.

Comments

9

To morning I spend some time doing what you asked to. so here are the steps (you can skip if you already have followed some).

  • Create a new blank work space
  • Add a project to it by clicking File->Add new files to "Your workSpace" or "command+option+A"
  • Choose your project folder Or yourproject.xcodeproj file

Just let the indexing finish properly, and congratulations you have added a new project to your xcode work space successfully.

Note: Make sure that project which you are adding is not already opened, Xcode get lil sensitive about that and doesn't show files tree in workspace in that case.

answered Feb 7, 2013 at 4:49

Comments

7

My answer pertains to XCode 5, but should pertain to XCode 4 as well.

In typical Apple fashion, they have given you multiple ways to do the almost the same thing. Very confusing and annoying. There are three ways, and only one way pertains to the original posters question:

(1) Use File --> Add Files to ... Problem with this, is that it will only add files to workspace if NO project has been selected. Problem with THAT, is that once you select a project, there is no way I know of to unselect it.

(2) Use the "+" in the lower-left corner. Problem with that, it is equivalent to using the pull down menu (#1 above)

(3) Right click in the left pane (in an empty area), and you will see "Add files to " This is the only right way to do it, as it guarantees that the file will be added to the workspace, and not any 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 more years to fix this sort of thing.

answered Jan 7, 2014 at 21:16

1 Comment

Just making a mark here that Apple still hasn't fixed being able to easily deselect your project in order to easily add items on the top level. We're about halfway to your 10 year mark now, only ~5 more years to go before they fix it!
3

One would think that adding a project to a Workspace in Xcode would be intuitive.

Of course not, this is Apple, only usable for certain experts...

1) But when you add a new project it is added within the existing project - It must be a bug, or is there actually a reason

You did miss the drop down selection list "Add to:" in the last of three dialog pages, the place where the location of the .xcodeproj file is specified. There you can select the Workspace you are currently using. So simply use "File" "New..." "Project...", give it a name and select from templates, and NEVER intuitiveley double click on the directory where to place the project file, but be sure to adjust the selection drop down list to your currently open workspace. Of course this choice is never preselected.

answered Mar 31, 2015 at 12:00

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.