How do I declare a debug only statement

You can use

#ifdef DEBUG
    ....
#endif

You’ll need to add DEBUG=1 to the project’s preprocessor symbol definitions in the Debug configuration’s settings as that’s not done for you automatically by Xcode.

I personally prefer doing DEBUG=1 over checking for NDEBUG=0, since the latter implies that the default build configuration is with debug information which you then have to explicitly turn off, whereas ‘DEBUG=1’ implies turning on debug only code.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)