Skip to content

Instantly share code, notes, and snippets.

@fpillet
Created November 25, 2014 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fpillet/375065c948052b839e97 to your computer and use it in GitHub Desktop.
Save fpillet/375065c948052b839e97 to your computer and use it in GitHub Desktop.
dispatch_once_t once;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
dispatch_once(&once, ^{
NSLog(@"one");
dispatch_async(dispatch_get_main_queue(), ^{
once = 0;
dispatch_once(&once, ^{
NSLog(@"two");
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment