IOS Project Import JS file

Source: Internet
Author: User
Tags file copy

One, the iOS project import JS file

In general, the JS file added to the project will usually be copied directly to the project (drag), where the JS file may have only one level (a folder contains all the JS files), there may be a lot of folders, the JS file can be directly dragged into the project folder, The project will prompt for file copy, as shown in 1-1. Here you need to choose Create folder references so the folders show blue, 1-2 shown. If you choose Create groups creation, compile the JS file when the project runs, if the JS file is only run in the same folder is successful, but if it is shown in multi-level folder 1-2, the project runs when the specified path will not find the corresponding folder in the HTML interface.

Figure 1-1

Figure 1-2

Ii. File path Issues

1-2, the HTML file in the Blue Views folder directory, if the HTML file under the Yellow folder to find the path can be directly found, code:

[[NSBundle Mainbundle] pathforresource:@ "app" oftype:@ "html"]; If you need to write manually below the blue file, the code:

[[NSBundle Mainbundle] pathforresource:@ "Views/app" oftype:@ "html"], so that the corresponding path can be found.

Third, the difference between create groups and create folder references

    1. The most obvious folder color, the folder created by create groups is yellow, and the folder created by create references is blue.
    2. Create groups when the project is run, the CPP file under groups will be compiled, such as xx.h file inside the file, xx.h file is referenced in other files in the project, compile and run normally, but use Create folder References Create folder reference file Xx.h, compile run will error xx.h not found, because Create folder references simply create a reference to the file, these files will not be compiled, so you need to join its path when using.

IOS Project Import JS file

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.