是转载的内容,谢谢作者《日常工作之常用宏定义大全》
宏与const区别:
1.编译时刻不同,宏属于预编译 ,const属于编译时刻
2.宏能定义代码,const不能,多个宏对于编译会相对时间较长,影响开发效率,调试过慢,const只会编译一次,缩短编译时间。
3.宏不会检查错误,const会检查错误
强弱引用
1
2
|
#define LRWeakSelf(type) __weak typeof(type) weak##type = type;
#define LRStrongSelf(type) __strong typeof(type) type = weak##type;
自定义log
|