Skip to content

Instantly share code, notes, and snippets.

@phatblat
Created December 4, 2012 04:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phatblat/4200484 to your computer and use it in GitHub Desktop.
Save phatblat/4200484 to your computer and use it in GitHub Desktop.
Convert Xcode build setting to runtime ObjC string
// Pass Xcode build-time CONFIGURATION variable to runtime as an Objective-C string
#define QUOTE(name) #name
#define STR(macro) QUOTE(macro)
#define CONFIG_NAME_CSTR STR(CONFIGURATION)
#define CONFIG_NAME [NSString stringWithCString:CONFIG_NAME_CSTR encoding:NSUTF8StringEncoding]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment