diff --git a/Example/Classes/AFGowallaAPIClient.m b/Example/Classes/AFGowallaAPIClient.m index 9875d79..d8ee311 100644 --- a/Example/Classes/AFGowallaAPIClient.m +++ b/Example/Classes/AFGowallaAPIClient.m @@ -32,11 +32,10 @@ NSString * const kAFGowallaBaseURLString = @"https://api.gowalla.com/"; @implementation AFGowallaAPIClient + (id)sharedClient { - if (_sharedClient == nil) { - @synchronized(self) { - _sharedClient = [[self alloc] init]; - } - } + static dispatch_once_t oncePredicate; + dispatch_once(&oncePredicate, ^{ + _sharedClient = [[self alloc] init]; + }); return _sharedClient; }