43

I am looking at somebody else's project and they have another project embedded under 'Other Sources'. When I click on the project it shows me the build settings etc, and I can expand all the source underneath.

I want to do the same thing, but when I drag an xcodeproj file into my project I don't get the build settings or any of the source shown like in this other project. How do I do this?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Ray
  • 617
  • 1
  • 5
  • 6

3 Answers3

112

Just be sure that your added project is not open in another Xcode window.

BTW this is still valid with Xcode 7.2 beta.

MacTeo
  • 2,656
  • 1
  • 20
  • 23
51

Sorry to revamp the old question, but I just got the absolute answer for this problem.... maybe this can help the other....

To add Sub-Project to current project, It just simply drag the .xcodeproj from finder to xcode, place it in your project...

BUT... there is something must be done before doing this.... JUST OPEN ONE XCODE INSTANCE.... So, close the other instance when dragging .xcodeproj to xcode....

If you drag it while opening few xcode instance (opening few project at once), the .xcodeproj that you dragged can't be expanded and not just what you want...

hope this can help the other....

Regards

Tek Yin
  • 3,011
  • 3
  • 25
  • 42
  • If I remove/change location of subproject after adding the subproject to main project then the subproject and files are shown in red color. Should not we change location of subprojects? – Ganesh G Oct 25 '16 at 09:03
0

When you drag the new project to the source list in Xcode, make sure you drop it on top of the project header (the thing that you click to get to the build settings and targets).

edc1591
  • 10,146
  • 6
  • 40
  • 63
  • 1
    Thanks for the reply. This then asks me to create a new workspace, but the other project doesn't have a workspace and still manages to have the other project embedded within it. Is this the same technique? – Ray Apr 26 '11 at 00:15
  • Not sure. I just tried it with one of my Xcode projects and it worked without any dialogs appearing. I would just try experimenting by dropping it in different places. Make sure to keep a backup though just in case. – edc1591 Apr 26 '11 at 00:17
  • Tried this again and still didn't work. In the end I had to make a duplicate copy of the directory containing the project and then when I dropped it, I could see everything. It's like a project can only be a sub project of ONE other project? – Ray Apr 26 '11 at 23:52
  • @Ray, Yes, if you place the project at the same level as your main project, you need to create a new workspace. Make sure you have updated your main app for the (Build settings) "User Header Search Paths" and (Build Phases) Link Binary with Libraries. This is not perfect but at least it works. – tszming Apr 29 '11 at 09:32