(一)pch中宏定義
如下圖:
(二)調(diào)用:
(三)代碼:
#ifndef PrefixHeader_pch
#define PrefixHeader_pch
//如果oc 執(zhí)行以下
#ifdef __OBJC__
//日志
#ifdef DEBUG
#define ZWJLog(...)NSLog (__VA_ARGS__)
#else
#define ZWJLog(...)
#endif
//顏色
#define? ZWJColorA(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)/255.0]
#define? ZWJColor(r,g,b) ZWJColorA(r,g,b,255.0);
#define? ZWJRandomColor? ? ZWJColor(arc4random_uniform(255),arc4random_uniform(255),arc4random_uniform(255))
//國際化:
#define _ZWJLocalizedString(str)? NSLocalizedString(str, nil)
#import "XMGPerson.h"
// Include any system framework and library headers here that should be included in all compilation units.
// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
#endif
#endif /* PrefixHeader_pch */