Add the Cordova static library in xcode 4.6 to avoid tedious installation steps on the official website.

Source: Internet
Author: User

The first contact with Cordova was frightened by the Installation Guide on the official website. Later, we found that Cordova is a static library, which is easy to handle. Directly introduce it to our ready-made projects as a static library.

The steps are as follows. Fortunately, I persisted and continued to find another piece of information. The combination of the two pieces of information would be perfect. So I wrote a blog and saved it. I hope it will help you)

Follow the steps in English.

Use Cordova for iOS as static libraryby admin on Thu, 02/28/2013-11: 10

After version 2.0.0 Cordova library for iOS provided as xcode project.
The main problem is that you can not open two projects with Cordova, only one.
But you can use the following trick to get around this.
1. Set "Skip install" Property of cordovalib project to "no ". In this configuration, you must set no. Skip the restrictions that can be used to install cordeva.

2. Run "product" => "ARCHIVE" command from menu. After successful build was opened Organizer-archives (release version is used here)
3. Press "Distribute" button, select "Save build products" and press next
4. Save Cordova Library Build
5. On file system you can see a files

6. After it You cocould include this file in own project
6.1 open "build phases" tab and in "link binary with libraries" Press plus button, in dialog press "add other..." and select libcordova. A file

Introduce the released Lib.

6.2 open "build Settings" tab, find property with name "header search paths" and write full path to "include" folder of compiled Cordova Library

The path is where you previously released the Lib. Find the include file and drag the folder to "header search paths ". Select recursive.

7. Don't forget the reference of the header file (I forgot it from the beginning and struggled for a long time)

#ifdef CORDOVA_FRAMEWORK    #import <Cordova/CDV.h>#else    #import "CDV.h"#endif

 

You woshould just have:

    #import <Cordova/CDV.h>

 

It is best to put these two header files in the prefix file so that you do not need to write import everywhere.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.