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]