Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Blakeasd

macrumors 6502a
Original poster
Dec 29, 2009
643
0
Hello,
I downloaded a framework off the internet and it came in the form of an Xcode project. The target of the project I downloaded is a framework, I am trying to get the .framework and add it to my own project for use. I tried the Build > Archive the project, but nothing appeared in the Organizer. How do I get the .framework file?
Thanks
(I am using Xcode 4)
 

Blakeasd

macrumors 6502a
Original poster
Dec 29, 2009
643
0
I just found some Apple documentation that says I can just add the framework Xcode Project to my App's Xcode project. I did this but I don't know how to do one step:
From Apple Documentation:
In your application project, modify the Header Search Paths setting of the application target by adding the directories containing any framework header files.

I know where I set this, but I am not sure what the directory would be.
Please Help,
Thanks
 

Sydde

macrumors 68030
Aug 17, 2009
2,552
7,050
IOKWARDI
I just found some Apple documentation that says I can just add the framework Xcode Project to my App's Xcode project. I did this but I don't know how to do one step:
From Apple Documentation:


I know where I set this, but I am not sure what the directory would be.
Please Help,
Thanks


  1. Menu: Project>Edit Project Settings
  2. Select the "Build" tab
  3. Scroll about halfway down, to "Search Paths"

Of course, if you have the source, you could just copy the files you need into your project and build them right in, though the ethicality of that is somewhat dubious.
 

Blakeasd

macrumors 6502a
Original poster
Dec 29, 2009
643
0
I know how to get there, I am not sure what to put though..
Thanks
 

jiminaus

macrumors 65816
Dec 16, 2010
1,449
1
Sydney
You should never need to adjust Header Search Paths when dealing with frameworks, only when dealing with dylibs.

To create a test a project:
  1. I created a Cocoa Application
  2. I created a Framework subproject
  3. In the build phases of the framework target, I ensured the relevant public headers where in the public part of the copy headers phase
  4. In the build phases of the application target, I added the framework to the target dependencies phase.
  5. Then I added the framework into the link binary with libraries phase.

Note that, as per usual with framework, you need to prefix the name of the framework when importing header files from it. For example, the framework is called MyFramework and you want to import MyClass.h, you need to import MyFramework/MyClass.h.

Also this setup will only work in your development environment. There's extra work to do to embed the framework inside your app bundle before distribution. But worry about that closer towards release.
 

jiminaus

macrumors 65816
Dec 16, 2010
1,449
1
Sydney
How did you create the subproject?

Right-click/control+click the parent project, then Add Project.

If you already have a project, right-click/control+click the parent project, then Add Files, choose the sub-projects .xcodeproj file.

Alternatively create a workspace containing the 2 projects. It's not critical to have a parent/child relationship between the projects.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.