Skip to content

How to use Mixare as library

eXaLy edited this page Jan 28, 2013 · 8 revisions

It's now possible to use Mixare as a library by adding Mixare to your project as sub-project. The pros of using as library:

  • You don't have to merge all Mixare source to your project, just read it (by adding as sub-project)
  • You can still update Mixare by git to your project, because of two separated repositories (Mixare and your own project)
  • You can write your own plugins in your project to communicate with Mixare library.

Step 1: Create Project

Step 1

First create an Empty Application. And save your project next to Mixare.

[Directories]
- Workspace
    - Mixare
    - Your new project

Step 2: Drag Mixare to your new project

Step 2

Drag Mixare project file to your project. I used 'Arena' as my new project.

Step 3: Initialize Mixare targets

Step 3

Go to your new project settings -> Your build target -> Build Phases -> Target Dependencies. Press the + button and add Resources and Library.

Step 4: Add library

Step 4

At the same Build Phases, you can add Mixare library to link it. The same method as adding a framework.

Step 5: Add Resource bundle

Step 5

To make use of images and xibs from Mixare library you should add the resources bundle. Expand subproject Mixare and the folder Products. Then drag Resources.bundle to Copy bundle resources.

Step 6: Languages support (optional)

Step 6

If you want language support for Dutch, German and Italian, then you can drag Localizable.strings from the folder Resources from subproject Mixare to Copy bundle resources. It will ask you for something, then press next or yes.

Step 7: Add required Frameworks

Step 7

Next to the Mixare library, you also have to add the required (non-default) Frameworks for Mixare. These are: MapKit.framework, CoreLocation.framework, QuartzCore.framework and AVFoundation.framework.

Step 8: Link path to library

Step 8

To use the Mixare library in your code, you have to make a working link to the library. Go to the Build Settings and search for Header Search Paths. Then add these two paths: "$(TARGET_BUILD_DIR)/lib/include" and "$(OBJROOT)/UninstalledProducts/include".

Step 9: Other linker flags

Step 9

Then you have to let it know that you are using Objective-C and load all stuff. Also in the Build Settings, search for Other Linker Flags and add these two: -ObjC and -all_load.

Step 10: Start your basic app with Mixare

Step 10

First of all, build your app once to initialize the library and bundle. The .a file and .bundle file shouldn't be red anymore after building. At your main delegate class, you can now import Mixare by #import <Mixare/Mixare.h>. Then you can create the MixareAppDelegate object and call the method -(void)runApplication. Before you run the application you can also initialize your own plugins and pre-initalize your data sources. Please read the other guides/tutorials for more explanation.

Possible issues

Issue

  • If you have issue by starting the app with Mixare, you could turn Build Active Architecture Only to Yes at Build Settings.
  • Issue with iPhone 5 could be with Valid Architectures armv7s. Just remove armv7s and turn Build Active Architecture Only to No.