Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #import "Thing.h" | |
| 2 | |
| 3 @interface Thing () | |
| 4 | |
| 5 @end | |
| 6 | |
| 7 @implementation Thing | |
| 8 | |
| 9 + (instancetype)thing { | |
| 10 static Thing* thing = nil; | |
| 11 static dispatch_once_t onceToken; | |
| 12 dispatch_once(&onceToken, ^{ | |
| 13 thing = [[[self class] alloc] init]; | |
| 14 }); | |
| 15 return thing; | |
| 16 } | |
| 17 | |
| 18 - (void)sayHello { | |
| 19 NSLog(@"Hello World"); | |
| 20 } | |
| 21 | |
| 22 @end | |
| OLD | NEW |