Manually add the. pch file after Xcode6,

Source: Internet
Author: User

Manually add the. pch file after Xcode6,

Before Xcode6, Xcode automatically creates a project name-Prefix under the Supporting files folder. the pch file is also a header file. The content of the pch header file can be shared and accessed by all other source files in the project. Is a pre-compiled file. Xcode6 will not be created automatically and needs to be created manually.

Its role:

1. Store some global macros (macros used throughout the project)

2. Used to include all header files (header files used throughout the project)


Next, go to the topic --> manually create a. pch file.

Command + N, open the new file window: ios-> other-> PCH file, create a pch file

Click Next to create. pch. Remember to check the project name


After creation, add "project name/pch file name" to the path of the precompile header option in building setting, and set Precompile Prefix Header to YES. The pre-compiled pch file will be cached, compilation speed can be improved


Common problems:

1. The. pch file is not found.

Open Finder


Drag the. pch file to the project name (Music) folder.


Delete the red. pch file and add it again.





2. in. the macro definition defined in the pch file cannot be used in the entire project. If you typed those letters, it didn't prompt because it was created. the project name is not checked when the pch file is created.


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.