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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -