Use pch to pre-compile the file,

Source: Internet
Author: User

Use pch to pre-compile the file,

First create a pch file, and then modify the Prefix Header in Build Setting of this project $ (SRCROOT)/project name/precompiled file name;

General Use of pch files:

1. Import the framework, such:

# Import <Foundation/Foundation. h>

# Import <UIKit/UIKit. h> and so on

2. macro definition

# Define KSCREENWIDTH [UIScreen mainScreen]. bounds. size. width // screen width
# Define KSCREENHEIGHT [UIScreen mainScreen]. bounds. size. height // screen height

// Interface data convenience program outsourcing convenient modification of this file
# Define US_BOX @ "us_box" // homepage Data Interface
# Define NEWS_LIST @ "news_list" // news interface // sets whether to DEBUG mode # define DEBUG 1 // it will not be printed after cancellation # ifdef DEBUG
# Define NSLog (s,...) NSLog (@ "% @", [NSString stringWithFormat :( s), ##__ VA_ARGS _])
# Else
# Define NSLog (s,...) # endif // macro defines a function to create a random color
# Define RGB (a) [UIColor colorWithRed: arc4random () % 10 *. 1 green: arc4random () % 10 *. 1 blue: arc4random () % 10 *. 1 alpha: a]
// Determine the device model
# Define DEVICENUM [[UIDevice currentDevice]. systemVersion floatValue]

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.