Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jun 8, 2011, 05:24 PM   #1
Blakeasd
macrumors 6502a
 
Join Date: Dec 2009
Building a Framework

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 is offline   0 Reply With Quote
Old Jun 8, 2011, 07:57 PM   #2
Blakeasd
Thread Starter
macrumors 6502a
 
Join Date: Dec 2009
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:
Quote:
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
Blakeasd is offline   0 Reply With Quote
Old Jun 8, 2011, 09:23 PM   #3
Sydde
macrumors 68000
 
Sydde's Avatar
 
Join Date: Aug 2009
Quote:
Originally Posted by Blakeasd View Post
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.
__________________
You got to be a spirit. You can't be no ghost.
Sydde is offline   0 Reply With Quote
Old Jun 8, 2011, 10:03 PM   #4
Blakeasd
Thread Starter
macrumors 6502a
 
Join Date: Dec 2009
I know how to get there, I am not sure what to put though..
Thanks
Blakeasd is offline   0 Reply With Quote
Old Jun 9, 2011, 06:09 AM   #5
jiminaus
macrumors 65816
 
Join Date: Dec 2010
Location: 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 is offline   0 Reply With Quote
Old Jun 9, 2011, 10:52 AM   #6
Blakeasd
Thread Starter
macrumors 6502a
 
Join Date: Dec 2009
How did you create the subproject?
Blakeasd is offline   0 Reply With Quote
Old Jun 9, 2011, 04:39 PM   #7
jiminaus
macrumors 65816
 
Join Date: Dec 2010
Location: Sydney
Quote:
Originally Posted by Blakeasd View Post
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.
jiminaus is offline   0 Reply With Quote
Old Jun 9, 2011, 06:34 PM   #8
Blakeasd
Thread Starter
macrumors 6502a
 
Join Date: Dec 2009
Thanks for your help, I got it working!
Blakeasd is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
QT Framework depreciated. larswik Mac Programming 4 Apr 4, 2014 04:55 PM
Quicktime Framework help Pat13 MacBook 5 Mar 2, 2013 08:08 PM
Which Framework: CodeIgniter or Laravel? Dunmail Web Design and Development 2 Feb 11, 2013 01:04 AM
When to Create a Framework BadWolf13 Mac Programming 14 Oct 13, 2012 04:44 PM

Forum Jump

All times are GMT -5. The time now is 06:52 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC