Closed viking2009 closed 10 years ago
Why not?
@interface WLClient : AFHTTPRequestOperationManager
+(instancetype)sharedClient { static WLClient *sharedWLClient = nil; static dispatch_once_t oncePredicate; dispatch_once(&oncePredicate, ^{ sharedWLClient = [[self alloc] initWithBaseURL:[NSURL URLWithString:@"https://api.wunderlist.com"]]; }); return sharedWLClient; }
use 'self' instead of creating each time
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
Good point! Changed, now WLClient is a subclass of AFHTTPRequestOperationManager instead of NSObject.
Thanks!
Why not?
use 'self' instead of creating each time