Tag Archives: iOS

Grand Central Dispatch Singletons

So… what’s the recommended way (thread safety + performance) to implement a singleton?

Well.. it looks pretty much like this!
[cc lang=”objc”]
+ (instancetype)sharedInstance
{
static dispatch_once_t pred;
static Foo* bar = nil;

dispatch_once(&pred, ^{ bar = [[Foo alloc] init]; });
return bar;
}[/cc]

iPad HD

Allright… this is already everywhere. Thing is, they managed to build a display of 9.7 inches… with a 2048x1536px resolution. How much more time it’s gonna take to build Macbooks with this new kind of display ?????.

That’s the question!