// 单列模式
static CustomAddressBook *instance;
+ (CustomAddressBook*)shareControl{
@synchronized(self) {
if(!instance) {
instance = [[CustomAddressBook alloc] init];
}
}
return instance;
}
解释:
// 单列模式
static CustomAddressBook *instance;
+ (CustomAddressBook*)shareControl{
@synchronized(self) {
if(!instance) {
instance = [[CustomAddressBook alloc] init];
}
}
return instance;
}
解释: