- Fix PNUser

This commit is contained in:
Giuseppe Nucifora 2016-01-29 13:13:10 +01:00
parent 17800e2ea5
commit 35c7b7ed68

View File

@ -31,7 +31,7 @@ static bool isFirstAccess = YES;
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
isFirstAccess = NO; isFirstAccess = NO;
SINGLETON = [[super allocWithZone:NULL] init]; SINGLETON = [[super allocWithZone:NULL] initForCurrentUser];
}); });
return SINGLETON; return SINGLETON;
@ -39,21 +39,6 @@ static bool isFirstAccess = YES;
#pragma mark - Life Cycle #pragma mark - Life Cycle
+ (instancetype) allocWithZone:(NSZone *)zone
{
return [self currentUser];
}
+ (instancetype)copyWithZone:(struct _NSZone *)zone
{
return [self currentUser];
}
+ (instancetype)mutableCopyWithZone:(struct _NSZone *)zone
{
return [self currentUser];
}
- (instancetype)copy - (instancetype)copy
{ {
return [[PNUser alloc] init]; return [[PNUser alloc] init];
@ -64,7 +49,7 @@ static bool isFirstAccess = YES;
return [[PNUser alloc] init]; return [[PNUser alloc] init];
} }
- (id) init - (instancetype) initForCurrentUser
{ {
if(SINGLETON){ if(SINGLETON){
return SINGLETON; return SINGLETON;