Search code examples
xcode4projects

How to make two projects depend on each other in XCode4?


So I have two XCode projects that I created with XCode 3. One is a host, the other one is a plugin. To run or debug the plugin, I have to start the host application and put the plugin in the resources folder of the host.

How can I accomplish that in XCode?

It seems like creating a workspace might be a great idea. I did that, then created a new scheme that would compile both projects. But I still don't get how I can copy the plugin bundle into the host application at build time.


Solution

  • I have been using workspaces since Xcode 4 came out and I have been setting up dependency projects as static libraries for common code. It does not work perfectly. I wrote about what I learned here...

    How do you get implicit dependencies to work with workspaces in Xcode 4?

    While I worked I found that the dependency projects do not always build and install as you run the target application. I find that if I clean and build it helps. I started to place a bit of code in the static libraries to return the version number and then I would frequently update the version number as I made code changes to the library and the target application would use NSLog to print the library versions to the console when the app was started. That would tip me off if the library was not built and installed with the current code base.

    I also found that Xcode 4 has had trouble with tracking the break point to the source across multiple builds. So I learned to restart Xcode from time to time. Fortunately it does close and reopen pretty quickly unlike other IDEs.

    I am hoping that with the next few releases Xcode 4 improves dramatically. This version was a complete rebuild from the ground up so I do expect some kinks that they will be working out for a bit.