原文:
https://blog.csdn.net/z929118967/article/details/113755392
pch头文件的内容能够被项目中的其他所有源文件共享和访问,通常我们可在pch文件定义一些全局的宏和导入一些基础类
例如:在pch文件中添加预处理指令,可以在发布应用的时候,一次性将NsLog语句移除;
选择 File > New > File > iOS > Other > PCH File 然后点击下一步;
#ifndef PrefixHeader_pch
#define PrefixHeader_pch
// 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.
#import "QCTConsts.h"
#import "UIWindow+Extension.h"
#pragma clang poison NSLog //移除程序中的指定identifier(标识符)
#endif /* PrefixHeader_pch */
如 TestDemo/TestDemo-Prefix.pch
在这里插入图片描述
GCC_PRECOMPILE_PREFIX_HEADER
这里写图片描述
#pragma clang poison identifier
应用场景:禁止使用ObjC 的运行时API
#pragma clang poison NSLog
在这里插入图片描述
1、原文:https://kunnan.blog.csdn.net/article/details/109624460 2、应用场景:区分调试模式和发布模式进行特殊处理 3、The DEBUG preprocessor macro setting in an Xcode project
4、发布模式关闭NSLog