Skip to content

Instantly share code, notes, and snippets.

@gabriel
Created July 1, 2009 08:51
Show Gist options
  • Save gabriel/138687 to your computer and use it in GitHub Desktop.
Save gabriel/138687 to your computer and use it in GitHub Desktop.
#ifdef DEBUG
#import <Foundation/NSDebug.h>
#import "GTMStackTrace.h"
void exceptionHandler(NSException *exception) {
NSLog(@"%@", GTMStackTraceFromException(exception));
}
#endif
int main(int argc, char *argv[]) {
#ifdef DEBUG
NSLog(@"Debug enabled");
NSDebugEnabled = YES;
NSZombieEnabled = YES;
NSDeallocateZombies = NO;
NSHangOnUncaughtException = YES;
[NSAutoreleasePool enableFreedObjectCheck:YES];
NSSetUncaughtExceptionHandler(&exceptionHandler);
#endif
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment