Configure and use the Xcode 7 PCH file-learn to use macro definition,

Source: Internet
Author: User

Configure and use the Xcode 7 PCH file-learn to use macro definition,

What is the purpose of using macros?

In actual development, sometimes some settings need to be used repeatedly (for example, set the print information, configure the color, and configure the width). It is very troublesome to manually create each time. Although macros occupy memory, most developers are currently using them.

 

1. Create a PCH File

2. Open the configuration panel and follow the procedure

3. Find the relevant configurations.

4. Configure PrefixHeader. pch

A. the first method is to configure the absolute path. Only your computer can configure the path.

We do not recommend that you use this configuration. If the configuration path is changed except your computer, the configuration will become unavailable.

The result is as follows:

B. method 2 configure the relative path

Recommended: the system will automatically find the folder where the content below is configured.

5. Modify the Prefix Header to yes.

6. Configure OK. You can use it. Haha!

Try to configure the screen bounds macro.

Next time you adapt to the screen, simply print the above macro.

Which one is better?

I'm not saying .... Hey

 

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.