Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 4 workspace: adding framework from project B as dependency to project A

This should be simple, but I can't figure out how to do this in Xcode 4:

I have an Xcode workspace with two top level projects:

  • Project A (app): the application depends on Framework built by project B
  • Project B (framework): one target to build the Framework

I would like to add the Framework target from Project B as a dependency to the application target of Project A. However, in the Build Phases > Target Dependencies for Project A's target, I only see Project A (not the framework target of Project B).

I'm still refining the framework so I wold like to have the application target build the framework automatically whenever it changed.

Is there a way to do this without making the framework project a child of Project A?

like image 224
Mark Avatar asked Sep 03 '11 09:09

Mark


People also ask

How do I add a framework to my workspace in Xcode?

To include a framework in your Xcode project, choose Project > Add to Project and select the framework directory. Alternatively, you can control-click your project group and choose Add Files > Existing Frameworks from the contextual menu.

How do I link an external framework in Xcode?

In general, to use an external framework in Xcode, you need to: Add a some kind of synchronised link to the external repository and download it. Add the . xcodeproj (Xcode project) file from the external repo as a sub-project to your own project, in Xcode's File Navigator.

How do I add a framework in Swiftui?

There are two ways to add the project to your app: Drag the framework into the project navigator, and then add the framework to the target. Add the framework to the project, and then add the framework to the target.


1 Answers

Here's what I finally figured out:

With both projects as top level projects in a workspace:

  • Add the framework project to Project A, but make sure "Copy.." is not checked when adding it. The framework project will then show up as child element in Project A and as top level element in the workspace.
like image 102
Mark Avatar answered Sep 30 '22 15:09

Mark