Why does Apple recommend to use dispatch_once for implementing the singleton pattern under ARC?
dispatch_once() is absolutely synchronous. Not all GCD methods do things asynchronously (case in point, dispatch_sync() is synchronous). The use of dispatch_once() replaces the following idiom: + (MyClass *)sharedInstance { static MyClass *sharedInstance = nil; @synchronized(self) { if (sharedInstance == nil) { sharedInstance = [[MyClass alloc] init]; } } return sharedInstance; } The benefit of dispatch_once() … Read more