Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add Private Framework to Target Dependencies?

I'm trying to embed a private framework (last paragraph) in my application bundle using XCode 4 and following Apple's (seemingly) outdated instructions.

In my case, I'm Using Separate Xcode Projects For Each Target. This is the final step:

In the General tab of the inspector window, add your framework as a dependency for the application. Adding this dependency causes Xcode to build the framework target before building the application target.

The build dependency you establish in the application target causes the framework to be built before the application. This is important because it guarantees that a built version of your framework will be available to link against and to embed in the application. Because of this dependency, you can set the active target of your Xcode project to your application and leave it there. Building the application now builds the framework and copies it to the application bundle directory, creating the necessary linkage between the two.

Yet, when in click on the + button in Target Dependencies the framework doesn't show up. How can I establish a build dependency between the private framework and the application target in Xcode 4?

Edit: I should clarify that I already got the private framework working. I just want to avoid having cleaning the project every time a change to the framework is made, and make sure the framework is built before the application target.

like image 547
hpique Avatar asked Sep 07 '12 16:09

hpique


People also ask

How do I embed a framework in Xcode?

Adding an External Respository, Sub-Project and a FrameworkAdd 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. Add the framework to your project's build phases.


1 Answers

Managed to solve this by adding the private framework project as a subproject, then adding the framework target in Target Dependencies.

However, in my case the framework target didn't show as an option in Target Dependencies until I deleted DerivedData. That nasty little bug drove me crazy.

like image 196
hpique Avatar answered Oct 21 '22 15:10

hpique