我应该在哪里放置这样的调试宏,我想将其用作全局。
#define DEBUG_MODE
#ifdef DEBUG_MODE
#define DebugLog( s, ... ) NSLog( @"<%p %@:(%d)> %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
#else
#define DebugLog( s, ... )
#endif
因为 prefix.pch 已在 Xcode 6 中被移除。
最佳答案
只创建一个Constant.h
文件。
import
view controllers
, macros
等需要为整个应用程序
导入。
像这样在 viewcontroller
中使用它:
#import "Constant.h"
关于ios - 我应该在哪里放置我的全局宏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28871894/