Add Cordova to an existing Xcode project in iOS

Source: Internet
Author: User

Add Cordova to an existing Xcode project in iOS

The Cordova official website has detailed the steps for creating a PhoneGao project. I will not go into details here.

In actual project development, you may need to add Cordova to an existing project. This problem has recently been encountered. Although there are some tutorials on the internet,

But it is no longer applicable to the latest version of Cordova.

 

1. Add a Demo project with the following directory structure:

2. Copy the Cordova files to the Demo directory. The directory structure is as follows:

3. Add CordovaLib. xcodeproj To the Demo project, right-click and choose Add Files To Demo.

4. Add the www directory to the project. Check "Create folder references ".

5. Add config. xml to the project in step 3. The directory structure is as follows:

6. Select Build Settings> Other Links of the project and set-Objc-all_load.

7. Select Build Phases-> New Run Script Phase and name the New Run Script Phase as copy www directory.

 

8. Build Phases-> Target Dependencies add CordovaLib

9. Link Binary With Librarys add libCordova. a, MobileCoreServices, AssetsLibrary

9. Now you can use Cordova normally. Note that other linkers must be set,

'-[_ NSCFConstantString JSONObject]: unrecognized selector sent to instance; otherwise, a similar error is prompted.

 

 

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.