#ifdef DEBUG
... Program Section 1 ...
#else
... Program Section 2 ...
#endif
This indicates that if the identifier debug has been defined by the # define command, the program Segment 1 is compiled, otherwise the program segment 2 is compiled. The #ifdef means if define (if it has a # define). The same #ifndef means that if not define (if there is no # define), it is contrary to #ifdef's meaning.
And where is debug defined?
There is a "debug=1" in "Target > Build Settings > Preprocessor Macros > Debug".
When you run, Test, analyze, it belongs to debug mode, when profile, archive is the release mode. See "Edit Scheme ..." in your iOS project
Because #ifdef Debug is done at compile time, it is compiled before appdelegate execution begins, so it executes before Didfinishlaunchingwithoptions executes.
Why is #ifdef debug in iOS executed before didfinishlaunchingwithoptions