Skip to content


Subversion checkout URL

You can clone with
Download ZIP


nesterow edited this page · 48 revisions

Here we assume that project directory is the directory where your project sits. And lib directory is the directory where TouchCustoms iPhone library resides.

Steps for integration in xCode 4

  1. Clone the repository
  2. In the project directory execute command: aleks$ git clone
  3. Create a new iOS project or open the one you’re currently working at. Drag TouchCustoms.xcodeproj from Finder to Frameworks folder in the project tree.
  4. Select main project’s name in the project tree. A property page should appear on the right. Select appropriate target (most likely it will be the only one to choose from) and go to Build Phases tab.
  5. There add TouchCustoms using (+) button in Target Dependecies group. Further on add libTouchCustoms.a to Link Binary with Libraries group.
  6. Now move to Build Settings tab and add the path where xCode will be able to find TouchCustoms headers. Usually you would like it to look like in the image:
    Setting header path for TouchCustoms lib in xCode 4
  7. Now you can safely use the project. If you double-click TouchCustoms.xcodeproj it will be opened in a new xCode window and you will be able to do any changes necessary. This is how xCode exposes Visual Studio’s multi-project scenario.

Working with git when having a lib from external git repo


Resolving Interface Builder issues

Linker optimizes the code that it includes in the final package, so if you’re using a class only in Interface Builder, it will be stripped out, and the runtime will be able to create an instance only of the base class that it will manage to find.

To prevent this, call e.g. in main.m file any static method from your class. Every NSObject inheritor has version method, so you can use it safely for all your classes that you create for reuse and refactor to a static library:

int main(int argc, char *argv[]) {

    [SCRSegmentedControl version];

    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    int retVal = UIApplicationMain(argc, argv, nil, nil);
    [pool release];
    return retVal;

You could specify -ObjC і -all_load linker flag, but it will include all the source from a static library, usually this is not what you want, since it will bloat your final package with unused stuff.

Something went wrong with that request. Please try again.