Created
May 11, 2012 15:52
-
-
Save mysteriouspants/2660581 to your computer and use it in GitHub Desktop.
Save app delegates everywhere by shoving static data into C functions!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSDictionary * sharedFoo() { | |
static NSDictionary * foo; | |
static dispatch_once_t f; | |
dispatch_once(f, ^{ | |
foo = [NSDictionary dictionaryWithObjectsForKeys: | |
@"bar", @"foo"]; | |
}; | |
return foo; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment