1

I'd been happy using my debug statements until recently I upgraded Xcode and now they don't work.

#ifdef DEBUG
#   define SQLLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), 
                __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
#   define SQLLog(...)
#endif

What do I need to do to fix this ?

Jules
  • 7,568
  • 14
  • 102
  • 186

1 Answers1

2

I cannot explain why it used to work and after upgrading Xcode it stopped doing so, but possibly it has to do with the fact that it does use NDEBUG, which stands for "non debug"; NDEBUG is defined in the standard, DEBUG is not.

Short solution to your problem should be explicitly defining the DEBUG symbol under your project build configuration.

Have also a look at this post about: _DEBUG vs NDEBUG.

Community
  • 1
  • 1
sergio
  • 68,819
  • 11
  • 102
  • 123