why
In dev / release env, switch the default global variable :
- url
- other env variable
xcode setting
- PROJECT -> info -> Configurations,default only have “Debug” & “Release” tag
- Use scheme to switch the tag
- goto Targets,choose the “Macros” from target
- Build Setting -> Preprocessor Macros, you can find “Debug” & “Release” tag
- In Macros, set your tag & value
scheme switch
Debug & Realese tags are set by xcode Configuration
- edit scheme.
- select Run tag, switch the “Build Configuration” tag to change your build setting.
coding example
you can create a config.h or .pch to set your info.
1 |
|
1 |
|
Notice #if
and #ifdef
is diff.