39

Setup:

Xcode 4.3.1 (or 5.x)
OS X 10.7.3

I have reproduced this issue on two separate late-model Macs with this setup.

Steps:

  1. Create a new Mac "Cocoa Application" Xcode Project. File > New > Project… Name it "MyApp".
  2. Create a new Workspace: File > New > Workspace… Name it "MySuite".
  3. Drag MyApp.xcodeproj file from the Finder into the Project Navigator of "MySuite" Workspace.

Expected:
The Project Navigator of the "MySuite" Workspace should now show a full sub-Project for "MyApp" with Source, Targets, etc.

Actual:
"MySuite" Workspace Project Navigator shows a tiny MyApp.xcodeproj item in the Project Navigator. (see screenshots)


Dragging:

Dragging MyApp.xcodeproj to the Workspace

Result:

Result

What am I doing wrong in trying to add a Project to a Workspace?

Todd Ditchendorf
  • 11,217
  • 14
  • 69
  • 123
  • 6
    Do you have the project you're dragging open in another window? – Sam Soffes Mar 11 '12 at 18:37
  • 3
    Yes. Wow. Closing the other Project window and trying again fixed it. I guess that's a bug? You rock! Would you like to post your answer below for credit? :) – Todd Ditchendorf Mar 11 '12 at 18:39
  • It's actually supposed to work that way. I've seen alerts before saying you have this project already open, so you can't open it again. Really silly, but I guess it makes sense. – Sam Soffes Mar 11 '12 at 18:41
  • Yes, it's no different than trying to drag a file to another folder when it is currently open by another program. Can't be done. Right ? – Ric Mar 11 '12 at 18:41
  • Ric, I honestly would not agree. At the very least some warning dialog of what's going wrong would be helpful. Anyhow, now that I know the issue, I can easily work around. :) – Todd Ditchendorf Mar 11 '12 at 18:44
  • 1
    8 years later this helped me, this really odd behavior without any warning/info is still a present problem, after a decade... Damn. – itMaxence Jan 27 '21 at 12:58

1 Answers1

147

Be sure you don't have the project already open in another window. Xcode only lets you open a project one time. I've made this mistake a lot when working on a framework then trying to add it to an application.

Simply close the project you're trying to drag in's window and everything will be happy.

Sam Soffes
  • 14,831
  • 9
  • 76
  • 80