Objective-C Tips & Trick - Prioregroup.com
[Objective-C] Loggin (NSLog) only in Debug mode

// first define -DDEBUG=1 in Target --> Build Settings --> Other C Flags
// after define the macro below in .PCH file of your project
// and use it in the same way of NSLog.

#ifdef DEBUG
    #define LLog( s, ... ) NSLog( @"<%p %@:(%d)> %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
    #define LLog( s, ... )

Copyright © 1996-2019 Centro Studi Informatica di Danilo Priore. All rights reserved. P.I.10149810581.