Skip to content

Instantly share code, notes, and snippets.

@jcayzac
Created November 22, 2012 02:59
Show Gist options
  • Select an option

  • Save jcayzac/4129211 to your computer and use it in GitHub Desktop.

Select an option

Save jcayzac/4129211 to your computer and use it in GitHub Desktop.
NSNumber* const XXX;
__attribute__((constructor)) static void createConstants() {
@autoreleasepool {
*(NSNumber**)&XXX = [@1 retain];
}
}
__attribute__((destructor)) static void destroyConstants() {
[XXX release];
}
int main(int argc, char *argv[])
{
@autoreleasepool {
NSLog(@"XXX = %@", XXX);
return 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment