Il giorno 18/ago/2015, alle ore 18:00, Maxthon Chan <m...@maxchan.info> ha scritto: > > So the first class that is required is the main application class > CGIApplication. Being the analogue of UIApplication it is a singleton. Is > this the proper way of doing it? I cannot use @synchronized yet because there > is nothing to lock on:
if you used GCD, it would be simpler: + (instancetype)sharedInstance { static dispatch_once_t once; static id ret; dispatch_once( &once, ^{ ret = [[self alloc] init]; } ); return ret; } -- Simone Tellini http://tellini.info _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com