IOS add Cordova to existing Xcode projects

Source: Internet
Author: User

Cordova official website about how to create a Phonegao project is very detailed, here will not repeat.

The actual project development may need to add Cordova to existing projects, recently encountered this problem. Although there are some tutorials online,

However, it is not applicable to the latest version of Cordova, so the steps are documented below.


1. Join us already exists named Demo project, the directory structure is as follows:



2. Copy Cordova related files to the demo directory, copy the following directory structure as follows


3. Add Cordovalib.xcodeproj to Demo project, right click Add Files to "demo"


4. Add the WWW directory to the project, remember to tick the Create folder references

5. Follow step three to add Config. C to the project, the directory structure is as follows


6. Select the project build Settings->other Links, set-objc-all_load


7. Select Build phases->new Run script Phase to name the new run script Phase named copy www directory




8.Build phases->target Dependencies Add cordovalib

9.Link Binary with Librarys add libcordova.a, mobilecoreservices,assetslibrary




9. Next you can use Cordova Normally, note other linkers must be set,

'-[__nscfconstantstring Jsonobject]: Unrecognized selector sent to instance otherwise a similar error will be prompted


Reference Link: http://outof.me/embedding-cordovalib-in-your-iosphonegap-app-project/

IOS add Cordova to existing Xcode projects

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.