welcome to linkAR technical documentation

next previous

Quick Start Tutorial

2.1.- Setting up the Development Environment

If you are new to iOS developing the following steps will guide you through the very basics of getting started with apple mobile development.
If you already are an iOS developer and have the development environment set up skip to Create new project. Read more on Apple's developer site:


2.1.1.- Become an iOS Developer

AR Matcher applications can not run in the simulator, must be deployed on iOS devices.
You must enroll to the iOS Developer program to deploy applications on iOS devices.
You can enroll here:


2.1.2.- Install Xcode and the iOS SDK

Once you have enrolled in the iOS Developer program, you should have access to the iOS Dev Center.


Go to the Dev Center and download Xcode.


2.1.3.- Set up a Provisioning Profile

  1. Sign into the iOS Dev Center: http://developer.apple.com/membercenter/
  2. Go to the iOS Provisioning Portal
    1. Follow the process to obtain a certificate, assign a device, create an App ID and create a provisioning profile. Use the wildcard character (*) to build and install multiple applications with a single ID.
    2. Download the provisioning profile you have just created and install it on your computer (double click on it).

2.2.- Installing AR Matcher Framework and creating a Hello World

2.2.1.- Create new project

Select Create New Xcode Project from the splash screen (seen below) or file→new→project.. from the menu.

2.2.2.- Choose Single View Application template

It will give us a basic app template, with a single UIView we can add the AR matcher to.

2.2.3.- Fill project details

Make sure use Automatic Reference Counting is selected. Automatic Reference Counting is not mandatory but it makes memory management easier.

2.3.- SDK Files

  • Image Matching Framework
    • libs/
      • CVSDK.framework
      • EADUtilities.framework
  • samples/
    • HelloImageMatching
    • MatchingMyCamera
    • boxOfficeMatcher

2.3.- Create and configure the project

2.3.1.- Add the following frameworks

Click on the project icon in the project navigator view, and under Build Phases tab, add each framework by clicking on the + button in the Link Binary With Libraries forum.

  • Accelerate.framework
  • AVFoundation.framework
  • Foundation.framework
  • UIKit.framework
  • CoreMotion.framework
  • libiconv.dylib
  • CoreGraphics.framework
  • CoreMedia.framework
  • CoreVideo.framework
  • QuartzCore.framework

2.3.2.- Add the CVSDK (matcher) framework

  • Add the CVSDK framework and EADUtilities (as explained above) from the SDK
  • libs/
    • CVSDK.framework
    • EADUtilities.framework

Here is how your frameworks folder should look like after you finish:

  • On the top of ViewController.h Include the header file CVSDK.h and a class member of type cvSDK:
#import <UIKit/UIKit.h>
#import <CVSDK/ImageMatcher.h>
@interface ViewController : UIViewController <matcherProtocol, matcherQRProtocol> {
    ImageMatcher* _cvView;    
  • In ViewController.m alloc and init cvSDK in the viewDidLoad method and Set the App Key you received from the registration service in the website.
- (void)viewDidLoad
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    // Hide StatusBar
    // Init Matcher viewController    
    _cvView = [[ImageMatcher alloc] initWithAppKey:@"--Your API KEY--" useDefaultCamera:TRUE];
    // Register delegate
    _cvView.matcherDelegate = self;
    _cvView.matcherQRDelegate = self;
    // Start
    [_cvView start];
  • in viewDidAppear method present the cvSDK view:
- (void) viewDidAppear:(BOOL)animated
    [self presentViewController:_cvView animated:NO completion:nil];
  • Add these methods to implement matcherProtocol (we will explain that later)
  // TODO
-(void)singleQRrecognitionResult:(NSString *)code
  // TODO 

2.3.3.- Add Images to Match

In your project, press right button over the folder where you want to add the images.
Select Add files to “YOUR PROJECT NAME”:

Search the pictures under the HelloImageMatching project. (Add pic2.jpeg, pic3.jpeg, pic5.jpeg and ARLab@pic5jpegdetector_data.data for later sample)

  • Samples
    • HelloImageMatching
      • HelloImageMatching
        • images
          • pic2.jpeg
          • pic3.jpeg

2.3.4.- Add Linker Flags and Deactivate PNG Compression

It is necessary to add the following linker flags in the Build settings:
-mthumb -lstdc++ -lz -lm -mfpu=neon -mtune=cortex-a8 -mvectorize-with-neon-quad

  1. Click on the project icon in the project navigator view.
  2. Go to Build Settings.
  3. Search for Linker.
  4. Copy the linker flags into the Other Linker Flags (Any Architecture | Any SDK) at the project target column.

Additionally, deactivate iOS PNG Compression, that will prevent some PNG known issues. Click on the project icon in the project navigator view.

  1. Go to Build Settings.
  2. Search for PNG.
  3. Select NO at the Compress PNG Files option.

2.4.- How to Run

  • Connect a supported device (see 1.1)
  • Select the device from the target menu
  • Click on the Run button or cmd + r.

2.5.- How to Debug

  • After running, make a breakpoint at the wanted line to stop the debugger on runtime.
  • To make a breakpoint, click on the left margine of the line and a blue arrow will appear indicating a new breakpoint was made.
  • Click on the debug navigation or cmd+5, to browse a list of the breakpoints.

2.6.- How to upload to the AppStore