Does anyone have any preferences or comments about using either ...
static id sharedReactor = nil;
+(id)sharedInstance {
if(sharedReactor == nil) sharedReactor = [[super allocWithZone:NULL] init];
return sharedReactor;
}
OR:
static id sharedReactor = nil;
+(void)initialize {
if(sharedRandomReactor == nil) {
sharedRandomReactor = [[super allocWithZone:NULL] init];
}
+(id) sharedInstance {
return sharedReactor;
}
To my mind using +(void)initialize seems a lot more elegant, I am just curious what people with more experience than myself think of both approaches?
gary