7 @interface BaseClass : RootObject
8 + (instancetype)sharedInstance;
10 - (instancetype)initWithFoo:(int)foo;
13 static BaseClass *sharedInstance = (void *)0;
14 static int counter = 0;
16 @implementation BaseClass
17 + (instancetype)sharedInstance {
19 return sharedInstance;
21 sharedInstance = [[BaseClass alloc] initWithFoo:3];
22 return sharedInstance;
26 - (instancetype)initWithFoo:(int)foo {