小说网 找小说 无限小说 烟雨红尘 幻想小说 酷文学 深夜书屋

编写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

posted on 2016-05-28 15:53  王峰炬  阅读(99)  评论(0编辑  收藏  举报

导航