标签:isp blog ping 开发 font 本地 obj 宏定义 margin
// 加载本地xib
#define kMainBundleLoadXib(xibName) [[[NSBundle mainBundle] loadNibNamed:xibName owner:nil options:nil] lastObject]
单利定义
#pragma mark - 实例定义 #define SingletenInterface + (instancetype)sharedInstance; #pragma mark - 定义单例代码块 #define SingletenImpl static id _instace; + (id)allocWithZone:(struct _NSZone *)zone { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ _instace = [super allocWithZone:zone]; }); return _instace; } - (id)copyWithZone:(NSZone *)zone { return _instace; } + (instancetype)sharedInstance { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ _instace = [[self alloc] init]; }); return _instace; }
标签:isp blog ping 开发 font 本地 obj 宏定义 margin
原文地址:http://www.cnblogs.com/HJiang/p/7462230.html