Skip to content

Instantly share code, notes, and snippets.

@atnan
Forked from neror/gist:216705
Created October 26, 2009 08:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atnan/218497 to your computer and use it in GitHub Desktop.
Save atnan/218497 to your computer and use it in GitHub Desktop.
#import <UIKit/UIKit.h>
#import "GTMStackTrace.h"
#ifdef DEBUG
extern BOOL NSDebugEnabled;
extern BOOL NSZombieEnabled;
extern BOOL NSDeallocateZombies;
extern BOOL NSHangOnUncaughtException;
static void exceptionHandler(NSException *exception) {
FTLOG(@"%@", GTMStackTraceFromException(exception));
}
#endif
int main(int argc, char *argv[]) {
#ifdef DEBUG
NSLog(@"Debug enabled");
NSDebugEnabled = YES;
NSZombieEnabled = YES;
NSDeallocateZombies = NO;
NSHangOnUncaughtException = 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