看惯了什么tempSelf weakSelf,来点高大的
#define weakify(...) \ rac_keywordify \ metamacro_foreach_cxt(rac_weakify_,, __weak, __VA_ARGS__)#define unsafeify(...) \ rac_keywordify \ metamacro_foreach_cxt(rac_weakify_,, __unsafe_unretained, __VA_ARGS__)#define strongify(...) \ rac_keywordify \ _Pragma("clang diagnostic push") \ _Pragma("clang diagnostic ignored \"-Wshadow\"") \ metamacro_foreach(rac_strongify_,, __VA_ARGS__) \ _Pragma("clang diagnostic pop")#if DEBUG#define rac_keywordify autoreleasepool {}#else#define rac_keywordify try {} @catch (...) {}#endif
使用方法,进block前wesk一下,进block后strong一下
等等,有多个对象要处理这样用
把名字换下,更具个性,self任意用,赶紧试试吧