PCH file, pch File

Source: Internet
Author: User

PCH file, pch File

1. Introduction

The PCH file is a global reference shared file in Xcode programming. The header file or macro definition can be introduced here to facilitate access to multiple files in the program.

 

2. Create a PCH File

Open Project New File... -> IOS Other-> PCH File: Enter the PCH File name.

 

3. PCH file configuration

A. Find the Project> Build Settings and search for "Prefix Header".

B. Project name/PrefixHeader. pch (for example, weihuan/PrefixHeader. pch );

C. Change the Precompile Prefix Header to YES. The pre-compiled pch file will be cached to increase the compilation speed;

NOTE: If TARGETS is not selected as FastRenterTests, you should select FastRenter. Otherwise, the imported class file cannot be found.

 

4. Commonly Used PCH files

① Import the header file;

② Write common macros;

③ Define common constants;

 

 

5. Custom file name prefix settings when creating a file

 

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.