Skip to content

Instantly share code, notes, and snippets.

@romyilano
Created January 13, 2013 23:55
Show Gist options
  • Select an option

  • Save romyilano/4526921 to your computer and use it in GitHub Desktop.

Select an option

Save romyilano/4526921 to your computer and use it in GitHub Desktop.
A nice way to automatically turn your logs on and off instead of having to hand-erase them
// Do this in the -Prefix.pch file
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
// From Matt Neuberg / from Jens Alfke
// when you want the logs to be turned on then you set if(0) to 0
// when you want them turned off you set if(1)
#define MyLog if(0); else NSLog
#endif
// then in your other files such as viewcontroller.m
// use MyLog(@"sdfsdf %@", object); instead of NSLog
// when you want t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment