编写category时的便利宏(用于解决category方法从静态库中加载需要特别设置的问题)

代码摘录自YYKit:https://github.com/ibireme/YYKit


/**

 Add this macro before each category implementation, so we don't have to use
 -all_load or -force_load to load object files from static libraries that only
 contain categories and no classes.
 More info: http://developer.apple.com/library/mac/#qa/qa2006/qa1490.html .
 *******************************************************************************
 Example:
     YYSYNTH_DUMMY_CLASS(NSString_YYAdd)
 */
#ifndef YYSYNTH_DUMMY_CLASS
#define YYSYNTH_DUMMY_CLASS(_name_)
@interface YYSYNTH_DUMMY_CLASS_ ## _name_ : NSObject @end
@implementation YYSYNTH_DUMMY_CLASS_ ## _name_ @end
#endif

原文地址:https://www.cnblogs.com/fengju/p/6173623.html