objective c - Setting up user specific preprocessor macros for Xcode -
i'd able have specific code blocks such #ifdef some_variable
, value of variable filled @ project's build time if project being built on specific user's machine.
is possible?
you set value in "preprocessor macros" build settings. setting "some_variable=${user}" in build settings equivalent #define some_variable "jappleseed" in code.
then in code can this:
#define jappleseed 1 #define sjobs 2 #if dev_user == jappleseed nslog(@"hi jhonny"); #elif dev_user == sjobs nslog(@"hi steve"); #endif
note: contrived example if want string "jappleseed" use in code should using info.plist , not #define
Comments
Post a Comment