Home > objc-api

objc-api

Objc-api is a project mainly written in OBJECTIVE-C and C, based on the Apache-2.0 license.

libCatchClient is an Objective-C library that makes it easy to use the Catch.com API.

libCatchClient

CatchClient is an Objective-C library for iOS and MacOS X. It makes it easy to use the Catch.com REST API. Here's a quick preview...

CatchClient *client = [[[CatchClient alloc] initWithAppName:@"MyCoolApp" 
                                                    version:@"1.2.3" 
                                                        url:@"http://example.com/MyCoolApp/"] autorelease];

@try {
    // sign in
    [client signIn:@"username" password:@"pass1234"];

    // add a new note
    CatchApiNote *note = [[[CatchApiNote alloc] initWithText:@"Hello World!" location:nil] autorelease];
    [client addNote:note];
}
@catch (NSException *exception) {
    NSLog(@"Error: %@", [exception reason]);
}

Check out the library documentation for more. The CatchClient class is the primary interface, so you might want to start there.

Also, take a look at the DesktopDemo sample app to see an example of the library in use. The interesting stuff is in DesktopDemoAppDelegate.m.

Using libCatchClient in an Xcode4 Workspace

Using Xcode4's implicit dependency feature is the easiest way to use libCatchClient in your project.

  1. Create a new workspace. Add your application project (MyCoolApp.xcodeproj) to the workspace.

  2. Add the library project (CatchClient-iOS.xcodeproj or CatchClient-MacOS.xcodeproj) to the workspace. Add it as a toplevel item, not as a subordinate of the application project.

  3. Configure your application to link with libCatchClient.

    • Click the + button under Link Binary With Libraries.
    • Choose libCatchClient.a from the resulting dialog.
    • Drag the library to the Frameworks folder (to reduce clutter).
  4. Repeat the steps above for each of the following system libraries...

    • CoreLocation.framework
    • libz.1.2.3.dylib
    • SystemConfiguration.framework
    • CFNetwork.framework (for iOS projects)
    • MobileCoreServices.framework (for iOS projects)
  5. Set Header Search Paths to "$(BUILT_PRODUCTS_DIR)/usr/local/include" so that library headers are available during build.

  6. Add linker flags -ObjC -all_load to enable proper static library linking.

  7. Restart Xcode.

Previous:photo_app