How to write if condition in #ifdef. for Staging. in objective-c
In case if you want to negate the condition with 2 build targets, use like this.
#if !(TOWNTALK || EPISD)
Your question is not very clear... If you want multiple conditions in a #ifdef, here is a solution:
#if defined(MYAPP_RELEASE) && defined(MyApp_Staging)
// ...
#else
// ...
#endif
In Swift and Xcode 7, the syntax has changed:
#if DEBUG || RELEASE
let URL = "https://www.example.com/beta"
#elseif APPSTORE
let URL = "https://www.example.com/prod"
#endif
You could do something like this to contain all the different options including the new Staging Mode and make the whole statement cleaner:
#ifdef MYAPP_PRODUCTION
buildMode = @"Production";
#elif MYAPP_RELEASE
buildMode = @"Release";
#elif MYAPP_DEBUG
buildMode = @"Debug";
#elif MYAPP_STAGING
buildMode = @"Staging";
#endif