How to print out the method name and line number and conditionally disable NSLog?
Here are some useful macros around NSLog I use a lot: #ifdef DEBUG # define DLog(fmt, …) NSLog((@”%s [Line %d] ” fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) #else # define DLog(…) #endif // ALog always displays output regardless of the DEBUG setting #define ALog(fmt, …) NSLog((@”%s [Line %d] ” fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) The DLog macro is … Read more