-
blend (verb)
to combine different things in a way that produces a pleasant result.
a story that blends story and legend.
blend the sugar,eggs and flour
-
绝对的单例方法
static NSObject *_instance = nil;
锁住alloc方法,锁住init方法,锁住copy方法,才能保证是全局唯一单例
//锁定 alloc方法
+(id)allocWithZone:(struct _NSZone *)zone{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
_instance = [super allocWithZone:zone];
});
return _instance;
}
//锁定init方法
-(instancetype)init{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
_instance = [super init];
});
return _instance;
}
//锁定copy
- (id)copyWithZone:(NSZone __unused*)zone {
return _instance;
}
//锁定 mutable copy
- (id)mutableCopyWithZone:(NSZone __unused*)zone {
return _instance;
}