code_junkie

How do you print out a stack trace to the console/log in Cocoa?

Nov 11th, 2011
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. NSLog(@"%@",[NSThread callStackSymbols]);
  2.  
  3. #import <ExceptionHandling/NSExceptionHandler.h>
  4.  
  5. [[NSExceptionHandler defaultExceptionHandler] setExceptionHandlingMask: NSLogUncaughtExceptionMask | NSLogUncaughtSystemExceptionMask | NSLogUncaughtRuntimeErrorMask]
Add Comment
Please, Sign In to add comment