Xcode 4: Adding a Framework to Your Project

March 25th, 2011

Filed under: Mac Development, Xcode

To add a framework to your project, select the project file from the project navigator on the left side of the project window. Select the target from the project settings editor. Click the Summary button at the top of the editor.

Xcode 4 Linked Frameworks

You will see a list of linked frameworks and libraries in the project settings editor. Click the + button to add a framework or library to your project.

Tags:


12 thoughts on “Xcode 4: Adding a Framework to Your Project

  1. WMaxfield says:

    This does not work in XCode 4 when doing an IOS project. You have to click on “Build Phases” and then select “Link Binary with Libraries” then click on the “+” sign to add a framework. If the Link Binary with Libraries does not exist, click on the “Add Build Phase” button.

    All in all, XCode 4.0 made it much more difficult to do the work needed to get an app into the app store. I have yet to figure out how to actually debug an application. I can run it, but the set breakpoint did not work.

    Apple is trying to help Microsoft right now. If they keep trying, they will succeed.

  2. Mark Szymczyk says:

    You’re right. What I posted works only for Mac application projects, not iPhone projects.

    The Breakpoints button in the project window toolbar toggles running and debugging.

  3. natalie says:

    Ive added a PDFkit Framework to my project, now how do I find the Interface Builder Preference to add it to Palettes? I found a tutorial but not for Xcode4 so its not working.

  4. Mark Szymczyk says:

    The PDFKit user interface elements are part of Xcode 4′s object library. Choose View > Utilities > Object Library to open the object library in the lower right corner of the project window. Choose PDFKit from the Object Library pop-up menu.

  5. Alex Haddad says:

    Sometimes I see the Object kits under Objects library and sometimes I do not. Any clue why that is?

  6. Mark Szymczyk says:

    Alex,

    I don’t know why sometimes nothing shows up in the object library.

  7. Imran says:

    Hi all,

    What if I have multiple targets in my project and I want to add a framework to all these targets at once?
    I have tried adding a framework one by one for all targets but then, that framework appears more than once in project navigator :(

    Any clues?

  8. Mark Szymczyk says:

    Imran,

    I do not have a solution for you. I had the same problem with one of my projects and I never found a solution. I learned to live with the multiple copies of the framework folder in the project navigator.

  9. grumbler says:

    Hi All,

    Is there a way i can USE/IMPORT to PDFKit on my iPad Application?
    It is only available when a creating a project on MAC OS X
    Please help me, i’ve been searching for a week already.
    THANK YOU SO MUCH

  10. Mark Szymczyk says:

    grumbler,

    As far as I know PDFKit is not available for iPad. Read the following Stack Overflow question:

    Can we use PDFKit framework for iPad?

  11. I have a mac and am taking a computer science course for school. I downloaded xcode to write the programs. I am learning C++ in my class. I looked up how to write C++ programs online but it appears I am missing the C++ Tool template under the Command Utility Line to start making the program. The only things that appear under Mac OS X sidebar after clicking New Project are as follows: Application, Framework & Library, Application Plug-in, System Plug-in, and Other. It is Xcode version 3.2.6. If you could help at all it would be greatly appreciated. I am new to programming so my knowledge is limited, but hopefully it will expand.

  12. Mark Szymczyk says:

    Select Application under Mac OS X to find the command line tool project. If you are new to programming, I have an article on my site that walks you through the creation of a C++ command-line tool project. Click the Articles link on the sidebar to find it.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*