I'd like to log the call trace during certain points, like failed assertions, or uncaught exceptions.
This code works on any thread:
NSLog(@"%@", NSThread.callStackSymbols);
Returns an array containing the call stack symbols. Each element is an NSString object with a value in a format determined by the backtrace_symbols() function.
NSString
backtrace_symbols()
1.4m articles
1.4m replys
5 comments
57.0k users