标准的写法
空
简化后的宏
/**************************************************************/
// 执行一次
#undef XY_ONCE_BEGIN
#define XY_ONCE_BEGIN( __name ) \
static dispatch_once_t once_##__name; \
dispatch_once( &once_##__name , ^{
#undef XY_ONCE_END
#define XY_ONCE_END });
简化后的写法
- (IBAction)clickOnce:(id)sender {
XY_ONCE_BEGIN(a)
SHOWMBProgressHUD(@"only show once", nil, nil, NO, 2)
XY_ONCE_END
}
阅读全文