Without ARC
int main(int argc, char *argv[]) { 
 NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 
 int retVal = -1; 
 @try { 
 retVal = UIApplicationMain(argc, argv, nil, nil); 

 @catch (NSException* exception) { 
 NSLog(@"Uncaught exception: %@", exception.description); 
 NSLog(@"Stack trace: %@", [exception callStackSymbols]); 

 [pool release]; return retVal; 
}

With ARC

int main(int argc, char *argv[])

{

@autoreleasepool {

//        return UIApplicationMain(argc, argv, nil, NSStringFromClass([MCAppDelegate class]));

int retVal = -1;

@try {

retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([MCAppDelegate class]));

}

@catch (NSException *exception) {

NSLog(@”Uncaught exception: %@”, exception.description);

NSLog(@”Stack trace: %@”, [exception callStackSymbols]);

}

@finally {

//

}

return retVal;

}

}

Source: http://stackoverflow.com/questions/8100054/no-exception-stack-trace-in-console-under-xcode-4-2-ios-5
Advertisements