I want to log some events for debug builds. I have added below code in .pch file to log using DLog()
in debug only. I have added IS_DEBUG
macro in build setting.
#ifdef IS_DEBUG
#define DLog(...) NSLog(__VA_ARGS__)
#else
#define DLog(...)
#endif
To test if it works or not, I removed IS_DEBUG
from build setting and ran app. Issue is that it always logs irrespective of debug/release app.
Please note that I tried changing the name of both DLog
method and preprocessor macro to see it is due to same macro or method is defined somewhere else. But still it gives same issue, means same macro or method is not used else where.
Bryan's answer helped me in solving this issue. Only cleaning project and Xcode cache did not work for me. I reset the simulator and cleaned project. It got it worked.