Add precompiled header files to the app development process

Source: Internet
Author: User

Wait until you continue adding precompiled header files.

Xcode created a template project for us, great! But one thing that is not so satisfying is the question:

This is the initial file directory for a new project, and almost all files are in the same level directory, which will be a nightmare as the number of project files increases rapidly. So, we need to tidy up the file structure, which is also a preliminary project framework.

Also note that in the Xcode base directory, there should be a "supporting files" folder, where the main.m file is, and two storyboard files are in the base directory. But in the physical directory, this is not the case. Because Xcode's file directory has a logical directory structure, virtually all files can be in the same level directory.

In actual project management, it is recommended to avoid such situations so that the physical and logical directories of the files are consistent and easy to right-click to view in the Finder.

Very simply, we just need to create a new folder under the physical directory "supporting files" and drag the Info.plist and main.m files into it:

Back to Xcode, here's what happens:

Right-click the Info.plist file, the supporting files folder, and the main.m file directly.

Right-click the base folder, "Add Files to base", add supporting Files folder, and you can drag the supporting files folder to the appropriate index location:

At this point, the directory collation of the supporting files is complete.

Attention:
1. Because the plist file moved, so the project general configuration interface, the identity bar can not be resolved, only need to re-select the Plist file to
2. The path of the plist file needs to be reconfigured in the build settings interface, if Xcode is not automatically reconfigured

Adding precompiled Header Files

Precompiled header files, commonly used to refer to third-party frameworks and library header files, can also be referenced to store global macro definition header files for global use.

Right-click the New file, supporting files, and select the PCH file, such as:

Before confirming, tick target:base

Switch to the build settings interface, search in the search bar: prefix header, double-click in the target bar to enter: $ (srcroot)/base/supporting files/prefixheader.pch, such as:

At this point, the precompiled header file is added to complete, using subsequent re-logging.

Add precompiled header files to the app development process

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.