#import "ZBAccountInfo.h"
@interface ZBAccountInfo()
@end
static ZBAccountInfo *sharedObj = nil;
@implementation ZBAccountInfo
+(ZBAccountInfo *)sharedInstance{
@synchronized (self)
{
if (sharedObj == nil)
{
sharedObj= [[self alloc] init];
}
}
return sharedObj;
}
+(id)allocWithZone:(struct _NSZone *)zone{
@synchronized (self) {
if (sharedObj == nil) {
sharedObj = [super allocWithZone:zone];
return sharedObj;
}
}
return sharedObj;
}
@end
时间: 2024-10-25 21:07:16