![Stack Overflow](http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png)
I found this singleton code from Luke Redpath:
+ (id)sharedInstance
{
static dispatch_once_t pred = 0;
__strong static id _sharedObject = nil;
dispatch_once(&pred, ^{
_sharedObject = [[self alloc] init]; // or some other init method
});
return _sharedObject;
}
I wanted to use it ...