excluding NSLog's from release version of iPhone app

ios, iphone, objective-c, xcode

Solution

Use a macro like `DLog` to wrap `NSLog`, and turn it off in Release builds.

#ifdef DEBUG
#    define DLog(...) NSLog(__VA_ARGS__)
#else
#    define DLog(...) /* */
#endif

Comments absolutely don't matter. They are only in your source code, not the compiled output. You don't submit your source code to Apple, only the built copy of your app.

Problem

Could somebody go over how to exempt NSLog's from a release build of an app? Also, does it matter if comments are left in a release version? Thanks!

Original source

Related problems