atnan (owner)

Fork Of

Revisions

gist: 218497 Download_button fork
public
Public Clone URL: git://gist.github.com/218497.git
Embed All Files: show embed
Objective-C #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#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;
}