RSS Feed

How to add Three20 into your project

Posted on
  • Source: Download the Three20 source.
  • Three20 is compiled as a static library and the easiest way to add it to your project is to use Xcode’s “dependent project” facilities. Here’s how:
  • Clone the Three20 git repository:
    git clone git://github.com/facebook/three20.git
  • Locate the “Three20.xcodeproj” file under “Three20/src”. Drag Three20.xcodeproj and drop it onto the root of your Xcode project’s “Groups and Files” sidebar. A dialog will appear — make sure “Copy items” is unchecked and “Reference Type” is “Relative to Project” before clicking “Add”.
  • Now you need to link the Three20 static library to your project. Click the “Three20.xcodeproj” item that has just been added to the sidebar. Under the “Details” table, you will see a single item: libThree20.a. Check the checkbox on the far right of libThree20.a.

  • Now you need to add Three20 as a dependency of your project, so Xcode compiles it whenever you compile your project. Expand the “Targets” section of the sidebar and double-click your application’s target. Under the “General” tab you will see a “Direct Dependencies” section. Click the “+” button, select “Three20”, and click “Add Target”.

  • Now you need to add the bundle of images and strings to your app. Locate “Three20.bundle” under “Three20/src” and drag and drop it into your project. A dialog will appear — make sure “Create Folder References” is selected, “Copy items” is unchecked, and “Reference Type” is “Relative to Project” before clicking “Add”.

  • Now you need to add the Core Animation framework to your project. Right click on the “Frameworks” group in your project (or equivalent) and select Add > Existing Frameworks. Then locate QuartzCore.framework and add it to the project.
  • Finally, we need to tell your project where to find the Three20 headers. Open your “Project Settings” and go to the “Build” tab. Be sure to select the appropriate active configuration (eg, Release vs. Debug — eventually you’ll need to change both). Look for “Header Search Paths” and double-click it. Add the relative path from your project’s directory to the “Three20/src” directory. If your project and the Three20 source are in the same parent, you would enter “../Three20/src”.
  • While you are in Project Settings, go to “Other Linker Flags” under the “Linker” section, and add “-ObjC” and “-all_load” to the list of flags.
  • You’re ready to go. Just #import “Three20/Three20.h” anywhere you want to use Three20 classes in your project.

!! Enjoy !!

Advertisements

About Muzammil

Over the past 6 years, I have designed, developed and managed over 150 iPhone/iPad applications for many large-scale clients, some include Rolex, Ford, Makemark LLC, Source Digital Production, IT City (Kingdom of Saudi Arabia), R.Ø.S.A. Creation etc. These applications ranged from simple navigation bar application to high end user interface design for image processing, simple games with Core Graphics and OpenGL. Before started Triffort Technologies i was working in Ampere Software Pvt Ltd as a senior iOS Developer. I was the first employe of Ampere who started iPhone/iPad development in the company. In ampere i worked on some complex apps like Boxboss, Austin Post, User Tracking etc. Throughout my career, I have used Core Graphics, OpenGL, SQLite, Core Data, JSON, XML etc. I am very proficient in many design programs including Photoshop, Illustrator, Flash, iMove. Although I am very knowledgeable in all Adobe Products. Most the time i am designing my apps without taking help from any graphics designer. I love to make app from my designs. It feels great when you are creating app from scratch and no body else is involve in your ideas. You are free to do anything. As the Senior Developer and Team lead at Triffort Technologies, I managed a team of Technical Interactive Developers and Designers. As their manager I am responsible for scheduling, resource management, task reviews, process development and enhancements, employee reviews and new employee hiring. I believe good employee morale and communication are key factors to successful, creative work, therefore, positive feedback was part of my daily routine. But most of the time you can find me on my desk writing codes for some app. I love programming. This is my passion. I’m a team player. I am a motivated individual who enjoys taking on new challenges and learning new technologies. I am well organized and a proficient multi-tasker. I have strong problem solving skills such as the ability to use technology in creative ways to meet unique project requirements. I love to be challenged and I always have a positive outlook no matter how tight the deadline is. If you would like to contact me or find out more about my experience, please contact me at muzammil@triffort.com or you can Skype me at muz.iphonedev.

18 responses »

  1. hi,
    i have done all the above steps, but at final when i import the “Three20/Three20.h” file in a class file its showing the error that “Three20/Three20.h” no such file or directory…..can u please help me….?

    Reply
  2. yes i have placed both the files an a same folder on the desktop….what should be the path then?

    thanks,
    Vijay.

    Reply
  3. 1. Compile your Three20 (sample code) and make sure it works fine.

    2. Avoid putting your project and Three20 on desktop.

    3. Path of your project:
    /Volumes/Projects/Muzammil Projects/myThree20Project (inside this you folder of your project name which .xcodeproj file)

    Path of your Three20 Library:
    /Volumes/Projects/Muzammil Projects/myThree20Project (inside this you have folder of name “three20) inside this you have 2 more folder of name “sample” and “src” and inside “src” you have Three20.xcodeproj file)

    Reply
  4. Thank you for your help sir….but what should be the header search path should be?
    I have given this….still the same error /Projects/Three20Project/Three20

    Reply
  5. three20 library file is in the path volume/Projects/Three20Project/

    Reply
  6. Try this Header Search Path: “../Three20/src”

    Reply
  7. the Three20.xcodeproj is not in src folder…inside src there is another folder Three20 inside that the xcodeproj file is present.

    Reply
  8. Pingback: How to add Three20 into your project | Advanced App Development

  9. thank you. good tip.

    Reply
  10. hi muzammil if i Clone the Three20 git repository in the terminal its showing the msg like this:–git:command not found…Will pls help me in this situation by your suggestion…Actually iam new to this IOS.

    Reply
  11. -bash: git://github.com/facebook/three20.git: No such file or directory
    now iam getting this error…

    Reply
  12. Hi
    Great work…. I have done all the above steps, but I am getting error in ‘CTCoreMessage.h’ file not found. Can you guide me it please….

    Reply
  13. Cool blog! Is your theme custom made or did you download it from somewhere?
    A design like yours with a few simple adjustements would really make my blog jump out.
    Please let me know where you got your theme. Thanks a lot

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: